Replacing Commons vfs by nio. Tests passing

This commit is contained in:
darksnake 2017-06-21 23:03:27 +03:00
parent f097dc8f70
commit 11552b6a6f

View File

@ -15,7 +15,6 @@
*/ */
package inr.numass.server; package inr.numass.server;
import hep.dataforge.data.binary.Binary;
import hep.dataforge.exceptions.StorageException; import hep.dataforge.exceptions.StorageException;
import hep.dataforge.io.envelopes.Envelope; import hep.dataforge.io.envelopes.Envelope;
import hep.dataforge.io.envelopes.EnvelopeBuilder; 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 { public NumassRun(String path, Storage workStorage, MessageFactory factory) throws StorageException {
this.storage = workStorage; this.storage = workStorage;
this.states = LoaderFactory.buildStateLoder(storage, RUN_STATE, null); 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.factory = factory;
this.runPath = path; this.runPath = path;
logger = LoggerFactory.getLogger("CURRENT_RUN"); logger = LoggerFactory.getLogger("CURRENT_RUN");
@ -168,8 +167,8 @@ public class NumassRun implements Metoid, Responder {
String filePath = message.meta().getString("path", ""); String filePath = message.meta().getString("path", "");
String fileName = message.meta().getString("name") String fileName = message.meta().getString("name")
.replace(NumassStorage.NUMASS_ZIP_EXTENSION, "");// removing .nm.zip if it is present .replace(NumassStorage.NUMASS_ZIP_EXTENSION, "");// removing .nm.zip if it is present
if(storage instanceof NumassStorage) { if (storage instanceof NumassStorage) {
((NumassStorage) storage).pushNumassData(filePath, fileName, Binary.readToBuffer(message.getData())); ((NumassStorage) storage).pushNumassData(filePath, fileName, message.getData().getBuffer());
} else { } else {
throw new StorageException("Storage does not support numass point push"); throw new StorageException("Storage does not support numass point push");
} }