net.i2p.util
Class SecureDirectory

java.lang.Object
  extended by java.io.File
      extended by 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
protected static boolean isNotWindows
           
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
SecureDirectory(File parent, String child)
           
SecureDirectory(String pathname)
           
SecureDirectory(String parent, String child)
           
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isNotWindows

protected static final boolean isNotWindows
Constructor Detail

SecureDirectory

public SecureDirectory(String pathname)

SecureDirectory

public SecureDirectory(String parent,
                       String child)

SecureDirectory

public SecureDirectory(File parent,
                       String child)
Method Detail

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