From 94cd39bbb61b0581f5a10b6ba76377bbd0a57240 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 17 May 2017 23:10:46 +0300 Subject: [PATCH] Fix for logFragment usage --- .../msp/src/main/resources/config/devices.xml | 2 +- .../numass/storage/NumassStorageFactory.java | 75 ++----------------- 2 files changed, 9 insertions(+), 68 deletions(-) diff --git a/numass-control/msp/src/main/resources/config/devices.xml b/numass-control/msp/src/main/resources/config/devices.xml index 50ad2faa..dc0731ce 100644 --- a/numass-control/msp/src/main/resources/config/devices.xml +++ b/numass-control/msp/src/main/resources/config/devices.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + diff --git a/numass-core/src/main/java/inr/numass/storage/NumassStorageFactory.java b/numass-core/src/main/java/inr/numass/storage/NumassStorageFactory.java index e6460f2d..b7416a96 100644 --- a/numass-core/src/main/java/inr/numass/storage/NumassStorageFactory.java +++ b/numass-core/src/main/java/inr/numass/storage/NumassStorageFactory.java @@ -2,6 +2,7 @@ package inr.numass.storage; import hep.dataforge.context.Context; import hep.dataforge.meta.Meta; +import hep.dataforge.meta.MetaBuilder; import hep.dataforge.storage.api.Storage; import hep.dataforge.storage.api.StorageType; @@ -9,74 +10,14 @@ import hep.dataforge.storage.api.StorageType; * Created by darksnake on 17-May-17. */ public class NumassStorageFactory implements StorageType { -// /** -// * Create root numass storage -// * -// * @param dir -// * @param readOnly -// * @return -// * @throws StorageException -// */ -// public static NumassStorage buildLocalNumassRoot(File dir, boolean readOnly, boolean monitor) throws StorageException { -// try { -// Meta meta = new MetaBuilder("storage") -// .setValue("type", "file.numass") -// .setValue("readOnly", readOnly) -// .setValue("monitor", monitor); -// return new NumassStorage(VFSUtils.getLocalFile(dir), meta); -// } catch (FileSystemException ex) { -// throw new RuntimeException(ex); -// } -// } -// -// public static NumassStorage buildLocalNumassRoot(File dir, boolean readOnly) throws StorageException { -// return buildLocalNumassRoot(dir, readOnly, false); -// } -// -// public static NumassStorage buildRemoteNumassRoot(String ip, int port, String login, String password, String path) throws StorageException { -// try { -// Meta meta = new MetaBuilder("storage") -// .setValue("type", "file.numass") -// .setValue("readOnly", true) -// .setValue("monitor", false); -// return new NumassStorage(VFSUtils.getRemoteFile(ip, port, login, password, path), meta); -// } catch (FileSystemException ex) { -// throw new RuntimeException(ex); -// } -// } -// -// public static NumassStorage buildNumassStorage(FileStorage parent, String path, boolean readOnly, boolean monitor) throws StorageException { -// Meta meta = new MetaBuilder("storage") -// .setValue("type", "file.numass") -// .setValue("readOnly", readOnly) -// .setValue("monitor", monitor); -// return new NumassStorage(parent, path, meta); -// } -// -// public static NumassStorage buildNumassRoot(String uri, boolean readOnly, boolean monitor) { -// try { -// Meta meta = new MetaBuilder("storage") -// .setValue("type", "file.numass") -// .setValue("readOnly", readOnly) -// .setValue("monitor", monitor); -// return new NumassStorage(VFSUtils.getFile(uri), meta); -// } catch (Exception ex) { -// throw new RuntimeException(ex); -// } -// } -// -// public static NumassStorage buildNumassRoot(URI uri, boolean readOnly, boolean monitor) { -// try { -// Meta meta = new MetaBuilder("storage") -// .setValue("type", "file.numass") -// .setValue("readOnly", readOnly) -// .setValue("monitor", monitor); -// return new NumassStorage(VFSUtils.getFile(uri), meta); -// } catch (Exception ex) { -// throw new RuntimeException(ex); -// } -// } + public static MetaBuilder buildStorageMeta(String path, boolean readOnly, boolean monitor){ + return new MetaBuilder("storage") + .setValue("path", path) + .setValue("type", "numass") + .setValue("readOnly", readOnly) + .setValue("monitor", monitor); + } @Override public String type() {