| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 * contributor license agreements. See the NOTICE file distributed with | |
| 4 * this work for additional information regarding copyright ownership. | |
| 5 * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 * (the "License"); you may not use this file except in compliance with | |
| 7 * the License. You may obtain a copy of the License at | |
| 8 * | |
| 9 * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 * | |
| 11 * Unless required by applicable law or agreed to in writing, software | |
| 12 * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 * See the License for the specific language governing permissions and | |
| 15 * limitations under the License. | |
| 16 */ | |
| 17 | |
| 18 package org.apache.tomcat.jni; | |
| 19 | |
| 20 /** Directory | |
| 21 * | |
| 22 * @author Mladen Turk | |
| 23 */ | |
| 24 public class Directory { | |
| 25 | |
| 26 /** | |
| 27 * Create a new directory on the file system. | |
| 28 * @param path the path for the directory to be created. (use / on all syste
ms) | |
| 29 * @param perm Permissions for the new directory. | |
| 30 * @param pool the pool to use. | |
| 31 */ | |
| 32 public static native int make(String path, int perm, long pool); | |
| 33 | |
| 34 /** Creates a new directory on the file system, but behaves like | |
| 35 * 'mkdir -p'. Creates intermediate directories as required. No error | |
| 36 * will be reported if PATH already exists. | |
| 37 * @param path the path for the directory to be created. (use / on all syste
ms) | |
| 38 * @param perm Permissions for the new directory. | |
| 39 * @param pool the pool to use. | |
| 40 */ | |
| 41 public static native int makeRecursive(String path, int perm, long pool); | |
| 42 | |
| 43 /** | |
| 44 * Remove directory from the file system. | |
| 45 * @param path the path for the directory to be removed. (use / on all syste
ms) | |
| 46 * @param pool the pool to use. | |
| 47 */ | |
| 48 public static native int remove(String path, long pool); | |
| 49 | |
| 50 /** | |
| 51 * Find an existing directory suitable as a temporary storage location. | |
| 52 * @param pool The pool to use for any necessary allocations. | |
| 53 * @return The temp directory. | |
| 54 * | |
| 55 * This function uses an algorithm to search for a directory that an | |
| 56 * an application can use for temporary storage. Once such a | |
| 57 * directory is found, that location is cached by the library. Thus, | |
| 58 * callers only pay the cost of this algorithm once if that one time | |
| 59 * is successful. | |
| 60 * | |
| 61 */ | |
| 62 public static native String tempGet(long pool); | |
| 63 | |
| 64 /** | |
| 65 * Open the specified directory. | |
| 66 * @param dirname The full path to the directory (use / on all systems) | |
| 67 * @param pool The pool to use. | |
| 68 * @return The opened directory descriptor. | |
| 69 */ | |
| 70 public static native long open(String dirname, long pool) | |
| 71 throws Error; | |
| 72 | |
| 73 /** | |
| 74 * close the specified directory. | |
| 75 * @param thedir the directory descriptor to close. | |
| 76 */ | |
| 77 public static native int close(long thedir); | |
| 78 | |
| 79 /** | |
| 80 * Rewind the directory to the first entry. | |
| 81 * @param thedir the directory descriptor to rewind. | |
| 82 */ | |
| 83 public static native int rewind(long thedir); | |
| 84 | |
| 85 | |
| 86 /** | |
| 87 * Read the next entry from the specified directory. | |
| 88 * @param finfo the file info structure and filled in by apr_dir_read | |
| 89 * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_
values | |
| 90 * @param thedir the directory descriptor returned from apr_dir_open | |
| 91 * No ordering is guaranteed for the entries read. | |
| 92 */ | |
| 93 public static native int read(FileInfo finfo, int wanted, long thedir); | |
| 94 | |
| 95 } | |
| OLD | NEW |