New implementation for storage
This commit is contained in:
parent
89a0cf7b42
commit
91cd73a905
@ -1,5 +1,5 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = "1.2.40"
|
ext.kotlin_version = "1.2.41"
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
maven {
|
maven {
|
||||||
|
@ -15,7 +15,7 @@ import java.util.*
|
|||||||
*/
|
*/
|
||||||
class NumassEnvelopeType : EnvelopeType {
|
class NumassEnvelopeType : EnvelopeType {
|
||||||
|
|
||||||
override val code: Int = DefaultEnvelopeType.DEFAULT_ENVELOPE_TYPE
|
override val code: Int = DefaultEnvelopeType.DEFAULT_ENVELOPE_CODE
|
||||||
|
|
||||||
override val name: String = "numass"
|
override val name: String = "numass"
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ val Envelope.dataStream: InputStream
|
|||||||
get() = if (this.meta.getString("compression", "none") == "zlib") {
|
get() = if (this.meta.getString("compression", "none") == "zlib") {
|
||||||
//TODO move to new type of data
|
//TODO move to new type of data
|
||||||
val inflatter = Inflater()
|
val inflatter = Inflater()
|
||||||
inflatter.setInput(data.buffer.array())
|
inflatter.setInput(data.read.array())
|
||||||
val bos = ByteArrayOutputStream()
|
val bos = ByteArrayOutputStream()
|
||||||
val buffer = ByteArray(8192)
|
val buffer = ByteArray(8192)
|
||||||
while (!inflatter.finished()) {
|
while (!inflatter.finished()) {
|
||||||
|
@ -72,7 +72,7 @@ interface NumassSet : Named, Metoid, Iterable<NumassPoint>, Provider {
|
|||||||
return optPoint(java.lang.Double.parseDouble(voltage))
|
return optPoint(java.lang.Double.parseDouble(voltage))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun defaultTarget(): String {
|
override fun getDefaultTarget(): String {
|
||||||
return NUMASS_POINT_PROVIDER_KEY
|
return NUMASS_POINT_PROVIDER_KEY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public class Main {
|
|||||||
throw new FileNotFoundException("Configuration file not found");
|
throw new FileNotFoundException("Configuration file not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
Meta config = MetaFileReader.read(configFile);
|
Meta config = MetaFileReader.Companion.read(configFile);
|
||||||
|
|
||||||
context.setValue(IOManager.ROOT_DIRECTORY_CONTEXT_KEY, configFile.getParent().toString());
|
context.setValue(IOManager.ROOT_DIRECTORY_CONTEXT_KEY, configFile.getParent().toString());
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ object NumassUtils {
|
|||||||
*/
|
*/
|
||||||
fun writeEnvelope(stream: OutputStream, meta: Meta, dataWriter: (OutputStream) -> Unit) {
|
fun writeEnvelope(stream: OutputStream, meta: Meta, dataWriter: (OutputStream) -> Unit) {
|
||||||
try {
|
try {
|
||||||
TaglessEnvelopeType.instance.writer.write(
|
TaglessEnvelopeType.INSTANCE.writer.write(
|
||||||
stream,
|
stream,
|
||||||
EnvelopeBuilder()
|
EnvelopeBuilder()
|
||||||
.setMeta(meta)
|
.setMeta(meta)
|
||||||
|
@ -32,7 +32,7 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable {
|
|||||||
Path configFile = context.getIo().getFile(SERVER_CONFIG_PATH).getPath();
|
Path configFile = context.getIo().getFile(SERVER_CONFIG_PATH).getPath();
|
||||||
if (Files.exists(configFile)) {
|
if (Files.exists(configFile)) {
|
||||||
context.getLogger().info("Trying to read server configuration from {}", SERVER_CONFIG_PATH);
|
context.getLogger().info("Trying to read server configuration from {}", SERVER_CONFIG_PATH);
|
||||||
configure(MetaFileReader.read(configFile));
|
configure(MetaFileReader.Companion.read(configFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user