public class IoFile extends Object implements File
| Modifier | Constructor and Description |
|---|---|
protected |
IoFile(File ioFile) |
protected |
IoFile(File parent,
String child) |
protected |
IoFile(String pathname) |
protected |
IoFile(String parent,
String child) |
protected |
IoFile(URI uri) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canExecute() |
boolean |
canRead() |
boolean |
canWrite() |
int |
compareTo(File otherFile) |
void |
copyToCopyAttributes(File toFile)
Copies a file, a symlink (depends on environment/implementation) or a directory (non-recursive).
|
File |
createFile(String... children)
Create a child-
File. |
IInputStream |
createInputStream() |
boolean |
createNewFile() |
IOutputStream |
createOutputStream() |
IOutputStream |
createOutputStream(boolean append) |
RandomAccessFile |
createRandomAccessFile(String mode) |
void |
createSymbolicLink(String targetPath) |
boolean |
delete() |
void |
deleteOnExit() |
void |
deleteRecursively() |
boolean |
equals(Object obj) |
boolean |
exists() |
boolean |
existsNoFollow() |
File |
getAbsoluteFile() |
String |
getAbsolutePath() |
File |
getCanonicalFile() |
String |
getCanonicalPath() |
long |
getFreeSpace() |
File |
getIoFile()
Caution: Only use this when forced by 3rd party interface!
|
long |
getLastModifiedNoFollow() |
String |
getName() |
File |
getParentFile() |
String |
getPath() |
long |
getUsableSpace() |
int |
hashCode() |
boolean |
isAbsolute() |
boolean |
isDirectory() |
boolean |
isDirectoryFollowSymLinks() |
boolean |
isDirectoryNoFollowSymLinks() |
boolean |
isFile() |
boolean |
isRegularFileFollowLinks() |
boolean |
isRegularFileNoFollowLinks() |
boolean |
isSymbolicLink() |
long |
lastModified() |
long |
length() |
String[] |
list() |
String[] |
list(FilenameFilter filenameFilter) |
File[] |
listFiles() |
File[] |
listFiles(FileFilter fileFilter) |
File[] |
listFiles(FileFilter fileFilter) |
File[] |
listFiles(FilenameFilter fileFilter) |
boolean |
mkdir() |
boolean |
mkdirs() |
void |
move(File toFile)
This is platform independent, in contrast to
File.renameTo(File) respectively File.renameTo(java.io.File). |
String |
readSymbolicLinkToPathString()
Convenience method for the often called chain:
java.io.File --> java.nio.Path --> Files.readSymbolicLink --> IOUtil.toPathString
Without symlinks, this method would not be needed.
|
String |
relativize(File target) |
boolean |
renameTo(File dest)
This is platform dependent (e.g.
|
boolean |
setExecutable(boolean executable) |
boolean |
setExecutable(boolean executable,
boolean ownerOnly) |
boolean |
setLastModified(long lastModified) |
boolean |
setLastModifiedNoFollow(long lastModified) |
boolean |
setReadable(boolean readable) |
boolean |
setReadable(boolean readable,
boolean ownerOnly) |
boolean |
setWritable(boolean writable) |
boolean |
setWritable(boolean writable,
boolean ownerOnly) |
String |
toString() |
URI |
toURI() |
public File getParentFile()
getParentFile in interface Filepublic String[] list(FilenameFilter filenameFilter)
public File[] listFiles(FileFilter fileFilter)
public File[] listFiles(FileFilter fileFilter)
public File[] listFiles(FilenameFilter fileFilter)
public File getAbsoluteFile()
getAbsoluteFile in interface Filepublic boolean existsNoFollow()
existsNoFollow in interface Filepublic boolean createNewFile() throws IOException
createNewFile in interface FileIOExceptionpublic boolean canExecute()
canExecute in interface Filepublic boolean setExecutable(boolean executable)
setExecutable in interface Filepublic boolean setExecutable(boolean executable, boolean ownerOnly)
setExecutable in interface Filepublic boolean setReadable(boolean readable)
setReadable in interface Filepublic boolean setReadable(boolean readable, boolean ownerOnly)
setReadable in interface Filepublic boolean setWritable(boolean writable)
setWritable in interface Filepublic boolean setWritable(boolean writable, boolean ownerOnly)
setWritable in interface Filepublic void deleteOnExit()
deleteOnExit in interface Filepublic void deleteRecursively()
deleteRecursively in interface Filepublic String getAbsolutePath()
getAbsolutePath in interface Filepublic File getCanonicalFile() throws IOException
getCanonicalFile in interface FileIOExceptionpublic String getCanonicalPath() throws IOException
getCanonicalPath in interface FileIOExceptionpublic long getFreeSpace()
getFreeSpace in interface Filepublic boolean isRegularFileNoFollowLinks()
isRegularFileNoFollowLinks in interface Filepublic boolean isRegularFileFollowLinks()
isRegularFileFollowLinks in interface Filepublic boolean isDirectoryNoFollowSymLinks()
isDirectoryNoFollowSymLinks in interface Filepublic boolean isDirectoryFollowSymLinks()
isDirectoryFollowSymLinks in interface Filepublic boolean isSymbolicLink()
isSymbolicLink in interface Filepublic String readSymbolicLinkToPathString() throws IOException
FilereadSymbolicLinkToPathString in interface FileIOExceptionpublic long getLastModifiedNoFollow()
getLastModifiedNoFollow in interface Filepublic boolean renameTo(File dest)
FileFile.renameTo(java.io.File).public boolean setLastModified(long lastModified)
setLastModified in interface Filepublic IOutputStream createOutputStream() throws FileNotFoundException
createOutputStream in interface FileFileNotFoundExceptionpublic IInputStream createInputStream() throws FileNotFoundException
createInputStream in interface FileFileNotFoundExceptionpublic IOutputStream createOutputStream(boolean append) throws FileNotFoundException
createOutputStream in interface FileFileNotFoundExceptionpublic void createSymbolicLink(String targetPath) throws IOException
createSymbolicLink in interface FileIOExceptionpublic long lastModified()
lastModified in interface Filepublic boolean isAbsolute()
isAbsolute in interface Filepublic boolean isDirectory()
isDirectory in interface Filepublic void move(File toFile) throws IOException
FileFile.renameTo(File) respectively File.renameTo(java.io.File).move in interface FileIOExceptionpublic void copyToCopyAttributes(File toFile) throws IOException
FilecopyToCopyAttributes in interface FileIOExceptionpublic RandomAccessFile createRandomAccessFile(String mode) throws FileNotFoundException
createRandomAccessFile in interface FileFileNotFoundExceptionpublic boolean setLastModifiedNoFollow(long lastModified)
setLastModifiedNoFollow in interface Filepublic String relativize(File target) throws IOException
relativize in interface FileIOExceptionpublic long getUsableSpace()
getUsableSpace in interface Filepublic File getIoFile()
Filepublic File createFile(String... children)
FileFile.
This method appends sub-path-elements. It is synonymous to
createFile(thisFile, children)
and more intuitive.
createFile in interface Filechildren - the children to be appended. May be null or empty.File. Never null.Copyright © 2013–2019. All rights reserved.