public class File extends File implements IModifiable
pathSeparator, pathSeparatorChar, separator, separatorChar| Constructor and Description |
|---|
File(File file)
Construct.
|
File(File parent,
String child)
Constructor.
|
File(File parent,
String child)
Construct.
|
File(String pathname)
Constructor.
|
File(String parent,
String child)
Constructor.
|
File(URI uri)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
File |
file(String name) |
String |
getExtension() |
Folder |
getParentFolder() |
InputStream |
inputStream() |
Time |
lastModifiedTime()
Returns a Time object representing the most recent time this file was modified.
|
OutputStream |
outputStream()
Creates a buffered output stream that writes to this file.
|
Object |
readObject() |
String |
readString() |
boolean |
remove() |
void |
sync()
Force contents of file to physical storage
|
String |
toQuotedString() |
int |
write(File file)
Writes the given file to this one
|
int |
write(InputStream input)
Writes the given input stream to this file
|
void |
write(String string)
Write the given string to this file
|
void |
writeObject(Serializable object) |
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURLpublic File(File file)
file - File from java.io packagepublic File(String pathname)
pathname - path namepublic File(String parent, String child)
parent - parentchild - childpublic File(URI uri)
uri - file uripublic String getExtension()
public Folder getParentFolder()
public InputStream inputStream() throws FileNotFoundException
FileNotFoundException - Thrown if the file cannot be foundpublic Time lastModifiedTime()
lastModifiedTime in interface IModifiablenull if
that information is not availablepublic OutputStream outputStream() throws FileNotFoundException
FileNotFoundException - Thrown if the file cannot be foundpublic String readString() throws IOException
IOExceptionpublic Object readObject() throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic void writeObject(Serializable object) throws IOException
object - Object to write to this fileIOExceptionpublic boolean remove()
File.delete()public void sync()
throws IOException
IOExceptionpublic String toQuotedString()
public int write(File file) throws IOException
file - The file to copyIOExceptionpublic int write(InputStream input) throws IOException
input - The inputIOExceptionpublic void write(String string) throws IOException
string - The string to writeIOExceptionCopyright © 2006–2020 Apache Software Foundation. All rights reserved.