org.knime.core.util.pathresolve
Interface URIToFileResolve


public interface URIToFileResolve

A service interface to convert a URI into a local file. The URI is usually (always?) either a file URI or a URI pointing into the team space (also file based), e.g. "knime:/MOUNT_ID/some/path/workflow.knime".

This interface is used to resolve URIs that are stored as part of referenced meta node templates.

Author:
Bernd Wiswedel, KNIME.com, Zurich, Switzerland

Method Summary
 File resolveToFile(URI uri)
          Resolves the given URI into a local file or throws an exception if that isn't possible (e.g.
 File resolveToLocalOrTempFile(URI uri)
          Resolves the given URI into a local file.
 

Method Detail

resolveToFile

File resolveToFile(URI uri)
                   throws IOException
Resolves the given URI into a local file or throws an exception if that isn't possible (e.g. because the URI does not represent a local file).

Parameters:
uri - The URI, e.g. "knime:/MOUNT_ID/some/path/workflow.knime"
Returns:
the local file represented by the URI.
Throws:
IOException - If the URI can't be resolved

resolveToLocalOrTempFile

File resolveToLocalOrTempFile(URI uri)
                              throws IOException
Resolves the given URI into a local file. If the URI does not represent a local file (e.g. a remote file on a server) it is downloaded first to a temporary directory and the the temporary copy is returned. If it represents a local file the behavior is the same as in resolveToFile(URI).

Parameters:
uri - The URI, e.g. "knime:/MOUNT_ID/some/path/workflow.knime"
Returns:
the file represented by the URI or a temporary copy of that file if it represents a remote file
Throws:
IOException - If the URI can't be resolved


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.