Class GenericFileChecker
java.lang.Object
ecmwf.common.technical.GenericFile
ecmwf.common.technical.GenericFileChecker
-
Nested Class Summary
Nested classes/interfaces inherited from class ecmwf.common.technical.GenericFile
GenericFile.IncorrectFileSize, GenericFile.IncorrectTransmittedSize, GenericFile.UnexpectedFileSize
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new generic file checker. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRead()
Can read.boolean
canWrite()
Can write.abstract void
catchException
(String service, Throwable t) Catch exception.boolean
delete()
Delete.boolean
exists()
Exists.Gets the absolute path.getFile()
Gets the file.Gets the generic file.Gets the input stream.getName()
Gets the name.Gets the output stream.getOutputStream
(boolean append) Gets the output stream.Gets the parent.Gets the parent file.getPath()
Gets the path.boolean
Checks if is absolute.boolean
Checks if is directory.boolean
isFile()
Checks if is file.long
Last modified.long
length()
Length.String[]
list()
List.String[]
list
(GenericFileFilter filter) List.long
Gives the number of files included in the specified directory and sub-directories.List files.listFiles
(GenericFileFilter filter) List files.long
listSize()
Gives the total size of the files included in the specified directory and sub-directories.boolean
mkdir()
Mkdir.boolean
mkdirs()
Mkdirs.long
receiveFile
(InputStream in, long size) Receive file.boolean
Rename to.boolean
setLastModified
(long time) Sets the last modified.boolean
Sets the read only.long
transmitFile
(OutputStream out, long offset) Transmit file.Methods inherited from class ecmwf.common.technical.GenericFile
delete, getGenericFile, getGenericFile, getGenericFile
-
Constructor Details
-
GenericFileChecker
Instantiates a new generic file checker.- Parameters:
file
- the file
-
-
Method Details
-
catchException
-
getGenericFile
-
getParentFile
Gets the parent file. Gets the parent file.- Specified by:
getParentFile
in classGenericFile
- Returns:
- the parent file
-
exists
Exists. Exists.- Specified by:
exists
in classGenericFile
- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getPath
Gets the path. Gets the path.- Specified by:
getPath
in classGenericFile
- Returns:
- the path
-
getAbsolutePath
Gets the absolute path. Gets the absolute path.- Specified by:
getAbsolutePath
in classGenericFile
- Returns:
- the absolute path
-
getParent
Gets the parent. Gets the parent.- Specified by:
getParent
in classGenericFile
- Returns:
- the parent
-
getName
Gets the name. Gets the name.- Specified by:
getName
in classGenericFile
- Returns:
- the name
-
renameTo
Rename to. Rename to.- Specified by:
renameTo
in classGenericFile
- Parameters:
path
- the path- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getFile
Gets the file. Gets the file.- Specified by:
getFile
in classGenericFile
- Returns:
- the file
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
delete
Delete. Delete.- Specified by:
delete
in classGenericFile
- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
mkdir
Mkdir. Mkdir.- Specified by:
mkdir
in classGenericFile
- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
mkdirs
Mkdirs. Mkdirs.- Specified by:
mkdirs
in classGenericFile
- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
canRead
public boolean canRead()Can read. Can read.- Specified by:
canRead
in classGenericFile
- Returns:
- true, if successful
-
canWrite
public boolean canWrite()Can write. Can write.- Specified by:
canWrite
in classGenericFile
- Returns:
- true, if successful
-
isAbsolute
Checks if is absolute. Checks if is absolute.- Specified by:
isAbsolute
in classGenericFile
- Returns:
- true, if is absolute
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
lastModified
Last modified. Last modified.- Specified by:
lastModified
in classGenericFile
- Returns:
- the long
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
setLastModified
Sets the last modified. Sets the last modified.- Specified by:
setLastModified
in classGenericFile
- Parameters:
time
- the time- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
setReadOnly
public boolean setReadOnly()Sets the read only. Sets the read only.- Specified by:
setReadOnly
in classGenericFile
- Returns:
- true, if successful
-
isDirectory
Checks if is directory. Checks if is directory.- Specified by:
isDirectory
in classGenericFile
- Returns:
- true, if is directory
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
isFile
Checks if is file. Checks if is file.- Specified by:
isFile
in classGenericFile
- Returns:
- true, if is file
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
length
Length. Length.- Specified by:
length
in classGenericFile
- Returns:
- the long
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
list
List. List.- Specified by:
list
in classGenericFile
- Parameters:
filter
- the filter- Returns:
- the string[]
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
listFiles
List files. List files.- Specified by:
listFiles
in classGenericFile
- Parameters:
filter
- the filter- Returns:
- the generic file[]
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
list
List. List.- Specified by:
list
in classGenericFile
- 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. List count.- Specified by:
listCount
in classGenericFile
- 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. List size.- Specified by:
listSize
in classGenericFile
- Returns:
- the long
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
listFiles
List files. List files.- Specified by:
listFiles
in classGenericFile
- Returns:
- the generic file[]
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getInputStream
Gets the input stream. Gets the input stream.- Specified by:
getInputStream
in classGenericFile
- Returns:
- the input stream
- Throws:
IOException
- Signals that an I/O exception has occurred.FileNotFoundException
-
getOutputStream
Gets the output stream. Gets the output stream.- Specified by:
getOutputStream
in classGenericFile
- Returns:
- the output stream
- Throws:
IOException
- Signals that an I/O exception has occurred.FileNotFoundException
-
getOutputStream
Gets the output stream. Gets the output stream.- Specified by:
getOutputStream
in classGenericFile
- Parameters:
append
- the append- Returns:
- the output stream
- Throws:
IOException
- Signals that an I/O exception has occurred.FileNotFoundException
-
transmitFile
Transmit file. Transmit file.- Specified by:
transmitFile
in classGenericFile
- Parameters:
out
- the outoffset
- the offset- Returns:
- the long
- Throws:
IOException
- Signals that an I/O exception has occurred.FileNotFoundException
-
receiveFile
Receive file. Receive file.- Specified by:
receiveFile
in classGenericFile
- Parameters:
in
- the insize
- the size- Returns:
- the long
- Throws:
IOException
- Signals that an I/O exception has occurred.FileNotFoundException
-