Package org.teiid.file
Class JavaVirtualFile
- java.lang.Object
-
- org.teiid.file.JavaVirtualFile
-
- All Implemented Interfaces:
VirtualFile
public class JavaVirtualFile extends Object implements VirtualFile
-
-
Constructor Summary
Constructors Constructor Description JavaVirtualFile(File f)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VirtualFile[]convert(File[] files)InputStreamFactorycreateInputStreamFactory()TheInputStreamFactoryfor utilizing this file as a blob or clob in the engine.longgetCreationTime()The creation time in UTC millisecondsstatic VirtualFile[]getFiles(String location, File datafile)longgetLastModified()The last modified time in UTC millisecondsStringgetName()Get the file namelonggetSize()The size in bytes.InputStreamFactory.StorageModegetStorageMode()Get theInputStreamFactory.StorageModeof this file.InputStreamopenInputStream(boolean lock)Open a stream for readingOutputStreamopenOutputStream(boolean lock)Open a stream for writing
-
-
-
Constructor Detail
-
JavaVirtualFile
public JavaVirtualFile(File f)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:VirtualFileGet the file name- Specified by:
getNamein interfaceVirtualFile
-
getLastModified
public long getLastModified()
Description copied from interface:VirtualFileThe last modified time in UTC milliseconds- Specified by:
getLastModifiedin interfaceVirtualFile
-
getCreationTime
public long getCreationTime()
Description copied from interface:VirtualFileThe creation time in UTC milliseconds- Specified by:
getCreationTimein interfaceVirtualFile
-
getSize
public long getSize()
Description copied from interface:VirtualFileThe size in bytes.- Specified by:
getSizein interfaceVirtualFile- Returns:
- the size or -1 if unknown.
-
openInputStream
public InputStream openInputStream(boolean lock) throws IOException
Description copied from interface:VirtualFileOpen a stream for reading- Specified by:
openInputStreamin interfaceVirtualFile- Parameters:
lock- true if a lock is requested. It's up to the implementation whether to actually honor the lock.- Throws:
IOException
-
openOutputStream
public OutputStream openOutputStream(boolean lock) throws IOException
Description copied from interface:VirtualFileOpen a stream for writing- Specified by:
openOutputStreamin interfaceVirtualFile- Parameters:
lock- true if a lock is requested. It's up to the implementation whether to actually honor the lock.- Throws:
IOException
-
createInputStreamFactory
public InputStreamFactory createInputStreamFactory()
Description copied from interface:VirtualFileTheInputStreamFactoryfor utilizing this file as a blob or clob in the engine.- Specified by:
createInputStreamFactoryin interfaceVirtualFile
-
getFiles
public static VirtualFile[] getFiles(String location, File datafile)
-
convert
public static VirtualFile[] convert(File[] files)
-
getStorageMode
public InputStreamFactory.StorageMode getStorageMode()
Description copied from interface:VirtualFileGet theInputStreamFactory.StorageModeof this file. Used byVirtualFile.createInputStreamFactory(). Defaults to OTHER (not local on disk nor memory).- Specified by:
getStorageModein interfaceVirtualFile- Returns:
-
-