public class File extends Object implements Comparable, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
pathSeparator |
static char |
pathSeparatorChar |
static String |
separator |
static char |
separatorChar |
Constructor and Description |
---|
File(File dir,
String name) |
File(String path) |
File(String dirname,
String name) |
File(URI uri) |
Modifier and Type | Method and Description |
---|---|
boolean |
_canRead() |
boolean |
_canWrite() |
boolean |
_createNew() |
boolean |
_delete() |
boolean |
_exists() |
boolean |
_isDirectory() |
boolean |
_isFile() |
long |
_lastModified() |
long |
_length() |
String[] |
_list() |
boolean |
_mkdir() |
boolean |
_setLastModified(long time) |
boolean |
_setReadOnly() |
boolean |
canRead() |
boolean |
canWrite() |
int |
compareTo(File pathname) |
int |
compareTo(Object obj) |
boolean |
createNewFile() |
static File |
createTempFile(String pre,
String suf) |
static File |
createTempFile(String pre,
String suf,
File dir) |
boolean |
delete() |
void |
deleteOnExit() |
boolean |
equals(Object obj)
Default object equality (is identity).
|
boolean |
exists() |
File |
getAbsoluteFile() |
String |
getAbsolutePath() |
File |
getCanonicalFile() |
String |
getCanonicalPath() |
String |
getName() |
String |
getParent() |
File |
getParentFile() |
String |
getPath() |
int |
hashCode()
The (default) object hashcode: for transient objects this is simply the
address of the instance in memory, for persistent objects it is the
address at which the instance was first created (maybe in a previous
activation of the VM).
|
boolean |
isAbsolute() |
boolean |
isDirectory() |
boolean |
isFile() |
boolean |
isHidden() |
long |
lastModified() |
long |
length() |
String[] |
list() |
String[] |
list(FilenameFilter filter) |
File[] |
listFiles() |
File[] |
listFiles(FileFilter filter) |
File[] |
listFiles(FilenameFilter filter) |
static File[] |
listRoots() |
boolean |
mkdir() |
boolean |
mkdirs() |
boolean |
renameTo(File dest) |
boolean |
setLastModified(long time) |
boolean |
setReadOnly() |
String |
toString()
Default String representation: overriden by many classes.
|
URI |
toURI() |
URL |
toURL() |
public static final String separator
public static final char separatorChar
public static final String pathSeparator
public static final char pathSeparatorChar
public File(String path) throws NullPointerException
NullPointerException
public File(String dirname, String name) throws NullPointerException
NullPointerException
public File(File dir, String name) throws NullPointerException
NullPointerException
public File(URI uri) throws NullPointerException, IllegalArgumentException
public static File[] listRoots()
public static File createTempFile(String pre, String suf) throws IllegalArgumentException, IOException
IllegalArgumentException
IOException
public static File createTempFile(String pre, String suf, File dir) throws IllegalArgumentException, IOException, SecurityException
public String toString()
Object
public boolean equals(Object obj)
Object
public int compareTo(File pathname)
public int compareTo(Object obj)
compareTo
in interface Comparable
public int hashCode()
Object
public String getName()
public String getPath()
public String getAbsolutePath()
public File getAbsoluteFile()
public String getCanonicalPath() throws IOException
IOException
public File getCanonicalFile() throws IOException
IOException
public String getParent()
public File getParentFile()
public boolean isAbsolute()
public boolean isHidden() throws SecurityException
SecurityException
public boolean createNewFile() throws IOException, SecurityException
IOException
SecurityException
public boolean _createNew() throws IOException
IOException
public boolean exists() throws SecurityException
SecurityException
public boolean _exists()
public String[] list() throws SecurityException
SecurityException
public String[] _list()
public String[] list(FilenameFilter filter) throws SecurityException
SecurityException
public File[] listFiles() throws SecurityException
SecurityException
public File[] listFiles(FilenameFilter filter) throws SecurityException
SecurityException
public File[] listFiles(FileFilter filter) throws SecurityException
SecurityException
public boolean canRead() throws SecurityException
SecurityException
public boolean _canRead()
public boolean canWrite() throws SecurityException
SecurityException
public boolean _canWrite()
public boolean isFile() throws SecurityException
SecurityException
public boolean _isFile()
public boolean isDirectory() throws SecurityException
SecurityException
public boolean _isDirectory()
public long lastModified() throws SecurityException
SecurityException
public long _lastModified()
public boolean setLastModified(long time) throws SecurityException
SecurityException
public boolean _setLastModified(long time)
public void deleteOnExit() throws SecurityException
SecurityException
public boolean setReadOnly() throws SecurityException
SecurityException
public boolean _setReadOnly()
public long length() throws SecurityException
SecurityException
public long _length()
public boolean mkdir() throws SecurityException
SecurityException
public boolean _mkdir()
public boolean mkdirs() throws SecurityException
SecurityException
public boolean renameTo(File dest) throws SecurityException
SecurityException
public boolean delete() throws SecurityException
SecurityException
public boolean _delete()
public URL toURL() throws MalformedURLException
MalformedURLException
public URI toURI()