From 11552b6a6f9c55360c0abbcecdb58cbd46f3eb98 Mon Sep 17 00:00:00 2001 From: darksnake Date: Wed, 21 Jun 2017 23:03:27 +0300 Subject: [PATCH] Replacing Commons vfs by nio. Tests passing --- .../src/main/java/inr/numass/server/NumassRun.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/numass-server/src/main/java/inr/numass/server/NumassRun.java b/numass-server/src/main/java/inr/numass/server/NumassRun.java index 45af1cca..7a0fa022 100644 --- a/numass-server/src/main/java/inr/numass/server/NumassRun.java +++ b/numass-server/src/main/java/inr/numass/server/NumassRun.java @@ -15,7 +15,6 @@ */ package inr.numass.server; -import hep.dataforge.data.binary.Binary; import hep.dataforge.exceptions.StorageException; import hep.dataforge.io.envelopes.Envelope; import hep.dataforge.io.envelopes.EnvelopeBuilder; @@ -72,7 +71,7 @@ public class NumassRun implements Metoid, Responder { public NumassRun(String path, Storage workStorage, MessageFactory factory) throws StorageException { this.storage = workStorage; this.states = LoaderFactory.buildStateLoder(storage, RUN_STATE, null); - this.noteLoader = LoaderFactory.buildObjectLoder(storage, RUN_NOTES, null); + this.noteLoader = LoaderFactory.buildObjectLoder(storage, RUN_NOTES, null); this.factory = factory; this.runPath = path; logger = LoggerFactory.getLogger("CURRENT_RUN"); @@ -168,8 +167,8 @@ public class NumassRun implements Metoid, Responder { String filePath = message.meta().getString("path", ""); String fileName = message.meta().getString("name") .replace(NumassStorage.NUMASS_ZIP_EXTENSION, "");// removing .nm.zip if it is present - if(storage instanceof NumassStorage) { - ((NumassStorage) storage).pushNumassData(filePath, fileName, Binary.readToBuffer(message.getData())); + if (storage instanceof NumassStorage) { + ((NumassStorage) storage).pushNumassData(filePath, fileName, message.getData().getBuffer()); } else { throw new StorageException("Storage does not support numass point push"); }