Class GenericFile
java.lang.Object
ecmwf.common.technical.GenericFile
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The Class IncorrectFileSize.static class
The Class IncorrectTransmittedSize.static class
The Class UnexpectedFileSize. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
canRead()
Can read.abstract boolean
canWrite()
Can write.abstract boolean
delete()
Delete.boolean
delete
(boolean recursive) Delete.abstract boolean
exists()
Exists.abstract String
Gets the absolute path.abstract File
getFile()
Gets the file.static GenericFile
getGenericFile
(GenericFile parent, String child) Gets the generic file.static GenericFile
getGenericFile
(String path) Gets the generic file.static GenericFile
getGenericFile
(String parent, String child) Gets the generic file.abstract InputStream
Gets the input stream.abstract String
getName()
Gets the name.abstract OutputStream
Gets the output stream.abstract OutputStream
getOutputStream
(boolean append) Gets the output stream.abstract String
Gets the parent.abstract GenericFile
Gets the parent file.abstract String
getPath()
Gets the path.abstract boolean
Checks if is absolute.abstract boolean
Checks if is directory.abstract boolean
isFile()
Checks if is file.abstract long
Last modified.abstract long
length()
Length.abstract String[]
list()
List.abstract String[]
list
(GenericFileFilter filter) List.abstract long
Gives the number of files included in the specified directory and sub-directories.abstract GenericFile[]
List files.abstract GenericFile[]
listFiles
(GenericFileFilter filter) List files.abstract long
listSize()
Gives the total size of the files included in the specified directory and sub-directories.abstract boolean
mkdir()
Mkdir.abstract boolean
mkdirs()
Mkdirs.abstract long
receiveFile
(InputStream in, long size) Receive file.abstract boolean
Rename to.abstract boolean
setLastModified
(long time) Sets the last modified.abstract boolean
Sets the read only.abstract long
transmitFile
(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.
-