Class SFile
- java.lang.Object
-
- net.sourceforge.plantuml.security.SFile
-
- All Implemented Interfaces:
Comparable<SFile>
public class SFile extends Object implements Comparable<SFile>
Secure replacement for java.io.File.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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
pathSeparator
static String
separator
static char
separatorChar
-
Method Summary
-
-
-
Method Detail
-
exists
public boolean exists()
-
getCanonicalFile
public SFile getCanonicalFile() throws IOException
- Throws:
IOException
-
isAbsolute
public boolean isAbsolute()
-
isDirectory
public boolean isDirectory()
-
getName
public String getName()
-
isFile
public boolean isFile()
-
lastModified
public long lastModified()
-
compareTo
public int compareTo(SFile other)
- Specified by:
compareTo
in interfaceComparable<SFile>
-
getPath
public String getPath()
-
length
public long length()
-
canWrite
public boolean canWrite()
-
setWritable
public void setWritable(boolean b)
-
delete
public void delete()
-
listFiles
public Collection<SFile> listFiles()
-
list
public String[] list()
-
getAbsoluteFile
public SFile getAbsoluteFile()
-
getParentFile
public SFile getParentFile()
-
getAbsolutePath
public String getAbsolutePath()
-
getPrintablePath
public String getPrintablePath()
-
canRead
public boolean canRead()
-
deleteOnExit
public void deleteOnExit()
-
mkdirs
public void mkdirs()
-
createTempFile
public static SFile createTempFile(String prefix, String suffix) throws IOException
- Throws:
IOException
-
toURI
public URI toURI()
-
renameTo
public boolean renameTo(SFile dest)
-
readRasterImageFromFile
public BufferedImage readRasterImageFromFile()
-
getBufferedImageFromWebpButHeader
public static BufferedImage getBufferedImageFromWebpButHeader(InputStream is)
-
openBufferedReader
public BufferedReader openBufferedReader()
-
conv
public File conv()
-
openFile
public InputStream openFile()
-
createBufferedOutputStream
public BufferedOutputStream createBufferedOutputStream() throws FileNotFoundException
- Throws:
FileNotFoundException
-
createPrintWriter
public PrintWriter createPrintWriter() throws FileNotFoundException
- Throws:
FileNotFoundException
-
createPrintWriter
public PrintWriter createPrintWriter(String charset) throws FileNotFoundException, UnsupportedEncodingException
-
createFileOutputStream
public FileOutputStream createFileOutputStream() throws FileNotFoundException
- Throws:
FileNotFoundException
-
createFileOutputStream
public FileOutputStream createFileOutputStream(boolean append) throws FileNotFoundException
- Throws:
FileNotFoundException
-
createPrintStream
public PrintStream createPrintStream() throws FileNotFoundException
- Throws:
FileNotFoundException
-
createPrintStream
public PrintStream createPrintStream(String charset) throws FileNotFoundException, UnsupportedEncodingException
-
createPrintStream
public PrintStream createPrintStream(Charset charset) throws FileNotFoundException, UnsupportedEncodingException
-
-