net.i2p.util
Class SecureDirectory
java.lang.Object
java.io.File
net.i2p.util.SecureDirectory
- All Implemented Interfaces:
- Serializable, Comparable<File>
- Direct Known Subclasses:
- SecureFile
public class SecureDirectory
- extends File
Same as File but sets the file mode after mkdir() so it can
be read and written by the owner only (i.e. 700 on linux)
As of 0.8.2, just use SecureFile instead of this.
- Since:
- 0.8.1
- Author:
- zzz
- See Also:
- Serialized Form
Method Summary |
boolean |
mkdir()
Sets directory to mode 700 if the directory is created |
boolean |
mkdirs()
Sets directory to mode 700 if the directory is created
Does NOT change the mode of other created directories |
protected void |
setPerms()
Tries to set the permissions to 700,
ignores errors |
Methods inherited from class java.io.File |
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, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL |
isNotWindows
protected static final boolean isNotWindows
SecureDirectory
public SecureDirectory(String pathname)
SecureDirectory
public SecureDirectory(String parent,
String child)
SecureDirectory
public SecureDirectory(File parent,
String child)
mkdir
public boolean mkdir()
- Sets directory to mode 700 if the directory is created
- Overrides:
mkdir
in class File
mkdirs
public boolean mkdirs()
- Sets directory to mode 700 if the directory is created
Does NOT change the mode of other created directories
- Overrides:
mkdirs
in class File
setPerms
protected void setPerms()
- Tries to set the permissions to 700,
ignores errors