Class GenericFile
java.lang.Object
ecmwf.common.technical.GenericFile
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Class IncorrectFileSize.static classThe Class IncorrectTransmittedSize.static classThe Class UnexpectedFileSize. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanRead()Can read.abstract booleancanWrite()Can write.abstract booleandelete()Delete.booleandelete(boolean recursive) Delete.abstract booleanexists()Exists.abstract StringGets the absolute path.abstract FilegetFile()Gets the file.static GenericFilegetGenericFile(GenericFile parent, String child) Gets the generic file.static GenericFilegetGenericFile(String path) Gets the generic file.static GenericFilegetGenericFile(String parent, String child) Gets the generic file.abstract InputStreamGets the input stream.abstract StringgetName()Gets the name.abstract OutputStreamGets the output stream.abstract OutputStreamgetOutputStream(boolean append) Gets the output stream.abstract StringGets the parent.abstract GenericFileGets the parent file.abstract StringgetPath()Gets the path.abstract booleanChecks if is absolute.abstract booleanChecks if is directory.abstract booleanisFile()Checks if is file.abstract longLast modified.abstract longlength()Length.abstract String[]list()List.abstract String[]list(GenericFileFilter filter) List.abstract longGives the number of files included in the specified directory and sub-directories.abstract GenericFile[]List files.abstract GenericFile[]listFiles(GenericFileFilter filter) List files.abstract longlistSize()Gives the total size of the files included in the specified directory and sub-directories.abstract booleanmkdir()Mkdir.abstract booleanmkdirs()Mkdirs.abstract longreceiveFile(InputStream in, long size) Receive file.abstract booleanRename to.abstract booleansetLastModified(long time) Sets the last modified.abstract booleanSets the read only.abstract longtransmitFile(OutputStream out, long offset) Transmit file.
-
Constructor Details
-
GenericFile
public GenericFile()
-
-
Method Details
-
getGenericFile
Gets the generic file.- Parameters:
parent- the parentchild- the child- Returns:
- the generic file
-
getGenericFile
Gets the generic file.- Parameters:
parent- the parentchild- the child- Returns:
- the generic file
-
getGenericFile
Gets the generic file.- Parameters:
path- the path- Returns:
- the generic file
-
exists
Exists.- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getPath
-
getAbsolutePath
-
getParent
-
getName
-
renameTo
Rename to.- Parameters:
path- the path- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getFile
Gets the file.- Returns:
- the file
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getParentFile
-
delete
Delete.- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
delete
Delete.- Parameters:
recursive- the recursive- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
mkdir
Mkdir.- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
mkdirs
Mkdirs.- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
canRead
public abstract boolean canRead()Can read.- Returns:
- true, if successful
-
canWrite
public abstract boolean canWrite()Can write.- Returns:
- true, if successful
-
isAbsolute
Checks if is absolute.- Returns:
- true, if is absolute
- Throws:
IOException- Signals that an I/O exception has occurred.
-
lastModified
Last modified.- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
setLastModified
Sets the last modified.- Parameters:
time- the time- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
setReadOnly
public abstract boolean setReadOnly()Sets the read only.- Returns:
- true, if successful
-
isDirectory
Checks if is directory.- Returns:
- true, if is directory
- Throws:
IOException- Signals that an I/O exception has occurred.
-
isFile
Checks if is file.- Returns:
- true, if is file
- Throws:
IOException- Signals that an I/O exception has occurred.
-
length
Length.- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
list
List.- Parameters:
filter- the filter- Returns:
- the string[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-
list
List.- Returns:
- the string[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-
listCount
Gives the number of files included in the specified directory and sub-directories.- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
listSize
Gives the total size of the files included in the specified directory and sub-directories.- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
listFiles
List files.- Parameters:
filter- the filter- Returns:
- the generic file[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-
listFiles
List files.- Returns:
- the generic file[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getInputStream
Gets the input stream.- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getOutputStream
Gets the output stream.- Returns:
- the output stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getOutputStream
Gets the output stream.- Parameters:
append- the append- Returns:
- the output stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
transmitFile
Transmit file.- Parameters:
out- the outoffset- the offset- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
receiveFile
Receive file.- Parameters:
in- the insize- the size- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-