public class SFile extends java.lang.Object implements java.lang.Comparable<SFile>
This class should be used instead of java.io.File. There are few exceptions (mainly in the Swing part and in the ANT task)
This class does some control access and in secure mode hide the real path of file, so that it cannot be printed to end users.
Modifier and Type | Field and Description |
---|---|
java.io.File |
internal |
static java.lang.String |
pathSeparator |
static java.lang.String |
separator |
static char |
separatorChar |
Constructor and Description |
---|
SFile(SFile basedir,
java.lang.String name) |
SFile(java.lang.String nameOrPath) |
SFile(java.lang.String dirname,
java.lang.String name) |
SFile(java.net.URI uri) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead() |
boolean |
canWrite() |
int |
compareTo(SFile other) |
java.io.File |
conv() |
java.io.BufferedOutputStream |
createBufferedOutputStream() |
java.io.FileOutputStream |
createFileOutputStream() |
java.io.FileOutputStream |
createFileOutputStream(boolean append) |
java.io.PrintStream |
createPrintStream() |
java.io.PrintStream |
createPrintStream(java.lang.String charset) |
java.io.PrintWriter |
createPrintWriter() |
java.io.PrintWriter |
createPrintWriter(java.lang.String charset) |
static SFile |
createTempFile(java.lang.String prefix,
java.lang.String suffix) |
void |
delete() |
void |
deleteOnExit() |
boolean |
equals(java.lang.Object obj) |
boolean |
exists() |
SFile |
file(java.lang.String name) |
static SFile |
fromFile(java.io.File internal) |
SFile |
getAbsoluteFile() |
java.lang.String |
getAbsolutePath() |
SFile |
getCanonicalFile() |
java.lang.String |
getName() |
SFile |
getParentFile() |
java.lang.String |
getPath() |
java.lang.String |
getPrintablePath() |
int |
hashCode() |
boolean |
isAbsolute() |
boolean |
isDirectory() |
boolean |
isFile() |
long |
lastModified() |
long |
length() |
java.lang.String[] |
list() |
java.util.Collection<SFile> |
listFiles() |
void |
mkdirs() |
java.io.BufferedReader |
openBufferedReader() |
java.io.InputStream |
openFile() |
java.awt.image.BufferedImage |
readRasterImageFromFile() |
boolean |
renameTo(SFile dest) |
void |
setWritable(boolean b) |
java.lang.String |
toString() |
java.net.URI |
toURI() |
public static java.lang.String separator
public static java.lang.String pathSeparator
public static char separatorChar
public final java.io.File internal
public SFile(java.lang.String nameOrPath)
public SFile(java.lang.String dirname, java.lang.String name)
public SFile(SFile basedir, java.lang.String name)
public SFile(java.net.URI uri)
public java.lang.String toString()
toString
in class java.lang.Object
public static SFile fromFile(java.io.File internal)
public SFile file(java.lang.String name)
public boolean exists()
public SFile getCanonicalFile() throws java.io.IOException
java.io.IOException
public boolean isAbsolute()
public boolean isDirectory()
public java.lang.String getName()
public boolean isFile()
public long lastModified()
public int compareTo(SFile other)
compareTo
in interface java.lang.Comparable<SFile>
public java.lang.String getPath()
public long length()
public boolean canWrite()
public void setWritable(boolean b)
public void delete()
public java.util.Collection<SFile> listFiles()
public java.lang.String[] list()
public SFile getAbsoluteFile()
public SFile getParentFile()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getAbsolutePath()
public java.lang.String getPrintablePath()
public boolean canRead()
public void deleteOnExit()
public void mkdirs()
public static SFile createTempFile(java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
java.io.IOException
public java.net.URI toURI()
public boolean renameTo(SFile dest)
public java.awt.image.BufferedImage readRasterImageFromFile()
public java.io.BufferedReader openBufferedReader()
public java.io.File conv() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.io.InputStream openFile()
public java.io.BufferedOutputStream createBufferedOutputStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.io.PrintWriter createPrintWriter() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.io.PrintWriter createPrintWriter(java.lang.String charset) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
public java.io.FileOutputStream createFileOutputStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.io.FileOutputStream createFileOutputStream(boolean append) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.io.PrintStream createPrintStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.io.PrintStream createPrintStream(java.lang.String charset) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
Copyright © 2020. All Rights Reserved.