public class FilePathZip extends FilePath
Constructor and Description |
---|
FilePathZip() |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite()
Check if the file is writable.
|
void |
createDirectory()
Create a directory (all required parent directories already exist).
|
boolean |
createFile()
Create a new file.
|
FilePath |
createTempFile(String suffix,
boolean deleteOnExit,
boolean inTempDir)
Create a new temporary file.
|
void |
delete()
Delete a file or directory if it exists.
|
boolean |
exists()
Checks if a file exists.
|
FilePath |
getParent()
Get the parent directory of a file or directory.
|
FilePathZip |
getPath(String path)
Convert a file to a path.
|
String |
getScheme()
Get the scheme (prefix) for this file provider.
|
boolean |
isAbsolute()
Check if the file name includes a path.
|
boolean |
isDirectory()
Check if it is a file or a directory.
|
long |
lastModified()
Get the last modified date of a file
|
void |
moveTo(FilePath newName)
Rename a file if this is allowed.
|
ArrayList<FilePath> |
newDirectoryStream()
List the files and directories in the given directory.
|
InputStream |
newInputStream()
Create an input stream to read from the file.
|
OutputStream |
newOutputStream(boolean append)
Create an output stream to write into the file.
|
FileChannel |
open(String mode)
Open a random access file object.
|
boolean |
setReadOnly()
Disable the ability to write.
|
long |
size()
Get the size of a file in bytes
|
FilePath |
toRealPath()
Normalize a file name.
|
get, getName, getNextTempFileNamePart, register, toString, unregister, unwrap
public FilePathZip getPath(String path)
FilePath
java.nio.file.spi.FileSystemProvider.getPath
, but may
return an object even if the scheme doesn't match in case of the the
default file provider.public void createDirectory()
FilePath
createDirectory
in class FilePath
public boolean createFile()
FilePath
createFile
in class FilePath
public void delete()
FilePath
public boolean exists()
FilePath
public long lastModified()
FilePath
lastModified
in class FilePath
public FilePath getParent()
FilePath
public boolean isAbsolute()
FilePath
isAbsolute
in class FilePath
public boolean isDirectory()
FilePath
isDirectory
in class FilePath
public boolean canWrite()
FilePath
public boolean setReadOnly()
FilePath
setReadOnly
in class FilePath
public long size()
FilePath
public ArrayList<FilePath> newDirectoryStream()
FilePath
newDirectoryStream
in class FilePath
public InputStream newInputStream() throws IOException
FilePath
newInputStream
in class FilePath
IOException
public FileChannel open(String mode) throws IOException
FilePath
open
in class FilePath
mode
- the access mode. Supported are r, rw, rws, rwdIOException
public OutputStream newOutputStream(boolean append)
FilePath
newOutputStream
in class FilePath
append
- if true, the file will grow, if false, the file will be
truncated firstpublic void moveTo(FilePath newName)
FilePath
public FilePath toRealPath()
FilePath
toRealPath
in class FilePath
public FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException
FilePath
createTempFile
in class FilePath
suffix
- the suffixdeleteOnExit
- if the file should be deleted when the virtual
machine existsinTempDir
- if the file should be stored in the temporary directoryIOException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.