Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  See the NOTICE file distributed with
  *  this work for additional information regarding copyright ownership.
  *  The ASF licenses this file to You under the Apache License, Version 2.0
  *  (the "License"); you may not use this file except in compliance with
  *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.tomcat.jni;

Directory

Author(s):
Mladen Turk
Version:
$Revision: 515 $, $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
public class Directory {

    
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.
    public static native int make(String pathint permlong 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.
    public static native int makeRecursive(String pathint permlong 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.
    public static native int remove(String pathlong 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.
    public static native String tempGet(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.
    public static native long open(String dirnamelong pool)
        throws Error;

    
close the specified directory.

Parameters:
thedir the directory descriptor to close.
    public static native int close(long thedir);

    
Rewind the directory to the first entry.

Parameters:
thedir the directory descriptor to rewind.
    public static native int rewind(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.
    public static native int read(FileInfo finfoint wantedlong thedir);
New to GrepCode? Check out our FAQ X