Search in sources :

Example 11 with IFileStoreHandler

use of org.knime.core.data.filestore.internal.IFileStoreHandler in project knime-core by knime.

the class FileNodePersistor method loadFileStoreHandler.

IFileStoreHandler loadFileStoreHandler(final Node node, final ExecutionMonitor execMon, final NodeSettingsRO settings, final WorkflowDataRepository workflowDataRepository) throws InvalidSettingsException {
    if (getLoadVersion().isOlderThan(LoadVersion.V260)) {
        return new EmptyFileStoreHandler(workflowDataRepository);
    }
    NodeSettingsRO fsSettings = settings.getNodeSettings("filestores");
    String dirNameInFlow = fsSettings.getString("file_store_location");
    if (dirNameInFlow == null) {
        return new EmptyFileStoreHandler(workflowDataRepository);
    } else {
        String uuidS = fsSettings.getString("file_store_id");
        UUID uuid = UUID.fromString(uuidS);
        ReferencedFile subDirFile = new ReferencedFile(getNodeDirectory(), dirNameInFlow);
        IFileStoreHandler fsh = WriteFileStoreHandler.restore(node.getName(), uuid, workflowDataRepository, subDirFile.getFile());
        return fsh;
    }
}
Also used : IFileStoreHandler(org.knime.core.data.filestore.internal.IFileStoreHandler) EmptyFileStoreHandler(org.knime.core.data.filestore.internal.EmptyFileStoreHandler) UUID(java.util.UUID) ReferencedFile(org.knime.core.internal.ReferencedFile)

Example 12 with IFileStoreHandler

use of org.knime.core.data.filestore.internal.IFileStoreHandler in project knime-core by knime.

the class WorkflowDataRepository method removeFileStoreHandler.

@Override
public void removeFileStoreHandler(final IWriteFileStoreHandler handler) {
    final UUID storeUUID = handler.getStoreUUID();
    if (storeUUID != null) {
        IFileStoreHandler old = m_handlerMap.remove(storeUUID);
        if (old == null) {
            throw new IllegalArgumentException("No such file store hander: " + handler);
        }
        LOGGER.debug("Removing handler " + handler + " - " + m_handlerMap.size() + " remaining");
    }
}
Also used : IFileStoreHandler(org.knime.core.data.filestore.internal.IFileStoreHandler) UUID(java.util.UUID)

Example 13 with IFileStoreHandler

use of org.knime.core.data.filestore.internal.IFileStoreHandler in project knime-core by knime.

the class WorkflowDataRepository method printValidFileStoreHandlersToLogDebug.

@Override
public void printValidFileStoreHandlersToLogDebug() {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Valid file store handlers are:");
        LOGGER.debug("--------- Start --------------");
        for (IFileStoreHandler fsh : m_handlerMap.values()) {
            LOGGER.debug("  " + fsh);
        }
        LOGGER.debug("--------- End ----------------");
    }
}
Also used : IFileStoreHandler(org.knime.core.data.filestore.internal.IFileStoreHandler)

Aggregations

IFileStoreHandler (org.knime.core.data.filestore.internal.IFileStoreHandler)13 UUID (java.util.UUID)5 IWriteFileStoreHandler (org.knime.core.data.filestore.internal.IWriteFileStoreHandler)5 ReferencedFile (org.knime.core.internal.ReferencedFile)4 EmptyFileStoreHandler (org.knime.core.data.filestore.internal.EmptyFileStoreHandler)3 ILoopStartWriteFileStoreHandler (org.knime.core.data.filestore.internal.ILoopStartWriteFileStoreHandler)3 LoopEndWriteFileStoreHandler (org.knime.core.data.filestore.internal.LoopEndWriteFileStoreHandler)3 ReferenceWriteFileStoreHandler (org.knime.core.data.filestore.internal.ReferenceWriteFileStoreHandler)3 File (java.io.File)2 IOException (java.io.IOException)2 LoopStartWriteFileStoreHandler (org.knime.core.data.filestore.internal.LoopStartWriteFileStoreHandler)2 NestedLoopStartWriteFileStoreHandler (org.knime.core.data.filestore.internal.NestedLoopStartWriteFileStoreHandler)2 WriteFileStoreHandler (org.knime.core.data.filestore.internal.WriteFileStoreHandler)2 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)2 BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1