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 TypeMethodDescriptionbooleancanRead()Can read.booleancanWrite()Can write.abstract voidcatchException(String service, Throwable t) Catch exception.booleandelete()Delete.booleanexists()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.booleanChecks if is absolute.booleanChecks if is directory.booleanisFile()Checks if is file.longLast modified.longlength()Length.String[]list()List.String[]list(GenericFileFilter filter) List.longGives the number of files included in the specified directory and sub-directories.List files.listFiles(GenericFileFilter filter) List files.longlistSize()Gives the total size of the files included in the specified directory and sub-directories.booleanmkdir()Mkdir.booleanmkdirs()Mkdirs.longreceiveFile(InputStream in, long size) Receive file.booleanRename to.booleansetLastModified(long time) Sets the last modified.booleanSets the read only.longtransmitFile(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:
getParentFilein classGenericFile- Returns:
- the parent file
-
exists
Exists. Exists.- Specified by:
existsin classGenericFile- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getPath
Gets the path. Gets the path.- Specified by:
getPathin classGenericFile- Returns:
- the path
-
getAbsolutePath
Gets the absolute path. Gets the absolute path.- Specified by:
getAbsolutePathin classGenericFile- Returns:
- the absolute path
-
getParent
Gets the parent. Gets the parent.- Specified by:
getParentin classGenericFile- Returns:
- the parent
-
getName
Gets the name. Gets the name.- Specified by:
getNamein classGenericFile- Returns:
- the name
-
renameTo
Rename to. Rename to.- Specified by:
renameToin 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:
getFilein classGenericFile- Returns:
- the file
- Throws:
IOException- Signals that an I/O exception has occurred.
-
delete
Delete. Delete.- Specified by:
deletein classGenericFile- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
mkdir
Mkdir. Mkdir.- Specified by:
mkdirin classGenericFile- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.
-
mkdirs
Mkdirs. Mkdirs.- Specified by:
mkdirsin 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:
canReadin classGenericFile- Returns:
- true, if successful
-
canWrite
public boolean canWrite()Can write. Can write.- Specified by:
canWritein classGenericFile- Returns:
- true, if successful
-
isAbsolute
Checks if is absolute. Checks if is absolute.- Specified by:
isAbsolutein classGenericFile- Returns:
- true, if is absolute
- Throws:
IOException- Signals that an I/O exception has occurred.
-
lastModified
Last modified. Last modified.- Specified by:
lastModifiedin 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:
setLastModifiedin 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:
setReadOnlyin classGenericFile- Returns:
- true, if successful
-
isDirectory
Checks if is directory. Checks if is directory.- Specified by:
isDirectoryin 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:
isFilein classGenericFile- Returns:
- true, if is file
- Throws:
IOException- Signals that an I/O exception has occurred.
-
length
Length. Length.- Specified by:
lengthin classGenericFile- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
list
List. List.- Specified by:
listin 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:
listFilesin classGenericFile- Parameters:
filter- the filter- Returns:
- the generic file[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-
list
List. List.- Specified by:
listin 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:
listCountin 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:
listSizein classGenericFile- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.
-
listFiles
List files. List files.- Specified by:
listFilesin 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:
getInputStreamin 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:
getOutputStreamin 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:
getOutputStreamin 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:
transmitFilein 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:
receiveFilein classGenericFile- Parameters:
in- the insize- the size- Returns:
- the long
- Throws:
IOException- Signals that an I/O exception has occurred.FileNotFoundException
-