alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Tomcat example source code file (Directory.java)

This example Tomcat source code file (Directory.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Tomcat tags/keywords

directory, directory, error, error, string, string

The Tomcat Directory.java source code

/*
 *  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 Mladen Turk
 * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
 */

public class Directory {

    /**
     * Create a new directory on the file system.
     * @param path the path for the directory to be created. (use / on all systems)
     * @param perm Permissions for the new direcoty.
     * @param pool the pool to use.
     */
    public static native int make(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.
     * @param path the path for the directory to be created. (use / on all systems)
     * @param perm Permissions for the new direcoty.
     * @param pool the pool to use.
     */
    public static native int makeRecursive(String path, int perm, long pool);

    /**
     * Remove directory from the file system.
     * @param path the path for the directory to be removed. (use / on all systems)
     * @param pool the pool to use.
     */
    public static native int remove(String path, long pool);

    /**
     * Find an existing directory suitable as a temporary storage location.
     * @param pool The pool to use for any necessary allocations.
     * @return 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.
     * @param dirname The full path to the directory (use / on all systems)
     * @param pool The pool to use.
     * @return The opened directory descriptor.
     */
    public static native long open(String dirname, long pool)
        throws Error;

    /**
     * close the specified directory.
     * @param thedir the directory descriptor to close.
     */
    public static native int close(long thedir);

    /**
     * Rewind the directory to the first entry.
     * @param thedir the directory descriptor to rewind.
     */
    public static native int rewind(long thedir);


    /**
     * Read the next entry from the specified directory.
     * @param finfo the file info structure and filled in by apr_dir_read
     * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
     * @param thedir the directory descriptor returned from apr_dir_open
     * No ordering is guaranteed for the entries read.
     */
    public static native int read(FileInfo finfo, int wanted, long thedir);

}

Other Tomcat examples (source code examples)

Here is a short list of links related to this Tomcat Directory.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.