com.notuvy.file
Class Directory

java.lang.Object
  extended by com.notuvy.file.Directory

public class Directory
extends Object

A utility for managing directories.

Version:
$Id: Directory.java,v 1.5 2006/06/20 04:52:41 murali Exp $
Author:
murali

Field Summary
static String APP_HOME_PROPERTY
           
static Directory HOME
           
 
Constructor Summary
Directory(File pFile)
           
Directory(String pString)
           
 
Method Summary
 void clear()
           
 DirectoryContents contents()
          Create the structure containing the contents of this directory, with plain files and subdirs segregated.
 void ensure()
           
static Directory ensure(File pFile)
           
static Directory ensure(String pFilename)
           
static Directory ensureInHome(String pFilename)
           
 File entry(String pFilename)
           
 Collection<File> findFileInSubdir(String pFilename)
           
 File getFile()
           
 boolean isEmpty()
           
 List<File> listContents()
          Find all the (first level) contents of this directory.
 List<File> listContents(FilenameFilter pFilter)
           
 List<File> listDeepContents()
          Find all the full depth contents of this directory.
 String relativeNameOf(File pFile)
           
 Directory setAppHome()
           
 Directory subdir(String pFilename)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HOME

public static final Directory HOME

APP_HOME_PROPERTY

public static final String APP_HOME_PROPERTY
See Also:
Constant Field Values
Constructor Detail

Directory

public Directory(File pFile)

Directory

public Directory(String pString)
Method Detail

ensure

public static Directory ensure(String pFilename)

ensure

public static Directory ensure(File pFile)

ensureInHome

public static Directory ensureInHome(String pFilename)

getFile

public File getFile()

ensure

public void ensure()

entry

public File entry(String pFilename)

subdir

public Directory subdir(String pFilename)

setAppHome

public Directory setAppHome()

listContents

public List<File> listContents()
Find all the (first level) contents of this directory.

Returns:
Unordered list of files, potentially a mix of plain files and subdirectories.

listDeepContents

public List<File> listDeepContents()
Find all the full depth contents of this directory. Follow all subdirectories. That is, do a depth-first search for all plain files.

Returns:
Unordered list of plain files.

contents

public DirectoryContents contents()
Create the structure containing the contents of this directory, with plain files and subdirs segregated.

Returns:
contents in a structured object.

listContents

public List<File> listContents(FilenameFilter pFilter)

isEmpty

public boolean isEmpty()

clear

public void clear()

findFileInSubdir

public Collection<File> findFileInSubdir(String pFilename)

relativeNameOf

public String relativeNameOf(File pFile)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.