Package 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
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
isNotWindows
-
Constructor Summary
Constructors Constructor Description SecureDirectory(File parent, String child)
SecureDirectory(String pathname)
SecureDirectory(String parent, String child)
-
Method Summary
Modifier and Type Method Description boolean
mkdir()
Sets directory to mode 700 if the directory is createdboolean
mkdirs()
Sets directory to mode 700 if the directory is created Does NOT change the mode of other created directoriesprotected void
setPerms()
Tries to set the permissions to 700, ignores errorsMethods 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, toPath, toString, toURI, toURL
-
Field Details
-
isNotWindows
protected static final boolean isNotWindows
-
-
Constructor Details
-
Method Details
-
mkdir
public boolean mkdir()Sets directory to mode 700 if the directory is created -
mkdirs
public boolean mkdirs()Sets directory to mode 700 if the directory is created Does NOT change the mode of other created directories -
setPerms
protected void setPerms()Tries to set the permissions to 700, ignores errors
-