org.apache.tomcat.jni

Class Directory

public class Directory extends Object

Directory

Version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $

Author: Mladen Turk

Method Summary
static intclose(long thedir)
close the specified directory.
static intmake(String path, int perm, long pool)
Create a new directory on the file system.
static intmakeRecursive(String path, int perm, long pool)
Creates a new directory on the file system, but behaves like 'mkdir -p'.
static longopen(String dirname, long pool)
Open the specified directory.
static intread(FileInfo finfo, int wanted, long thedir)
Read the next entry from the specified directory.
static intremove(String path, long pool)
Remove directory from the file system.
static intrewind(long thedir)
Rewind the directory to the first entry.
static StringtempGet(long pool)
Find an existing directory suitable as a temporary storage location.

Method Detail

close

public static int close(long thedir)
close the specified directory.

Parameters: thedir the directory descriptor to close.

make

public static int make(String path, int perm, long pool)
Create a new directory on the file system.

Parameters: path the path for the directory to be created. (use / on all systems) perm Permissions for the new direcoty. pool the pool to use.

makeRecursive

public static int makeRecursive(String path, int perm, long pool)
Creates a new directory on the file system, but behaves like 'mkdir -p'. Creates intermediate directories as required. No error will be reported if PATH already exists.

Parameters: path the path for the directory to be created. (use / on all systems) perm Permissions for the new direcoty. pool the pool to use.

open

public static long open(String dirname, long pool)
Open the specified directory.

Parameters: dirname The full path to the directory (use / on all systems) pool The pool to use.

Returns: The opened directory descriptor.

read

public static int read(FileInfo finfo, int wanted, long thedir)
Read the next entry from the specified directory.

Parameters: finfo the file info structure and filled in by apr_dir_read wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values thedir the directory descriptor returned from apr_dir_open No ordering is guaranteed for the entries read.

remove

public static int remove(String path, long pool)
Remove directory from the file system.

Parameters: path the path for the directory to be removed. (use / on all systems) pool the pool to use.

rewind

public static int rewind(long thedir)
Rewind the directory to the first entry.

Parameters: thedir the directory descriptor to rewind.

tempGet

public static String tempGet(long pool)
Find an existing directory suitable as a temporary storage location.

Parameters: pool The pool to use for any necessary allocations.

Returns: The temp directory. This function uses an algorithm to search for a directory that an an application can use for temporary storage. Once such a directory is found, that location is cached by the library. Thus, callers only pay the cost of this algorithm once if that one time is successful.

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.