]>
git.argeo.org Git - gpl/argeo-slc.git/blob - ext/javax.mail.mbox/src/com/sun/mail/mbox/FileInterface.java
2 * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v. 2.0, which is available at
6 * http://www.eclipse.org/legal/epl-2.0.
8 * This Source Code may also be made available under the following Secondary
9 * Licenses when the conditions for such availability set forth in the
10 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 * version 2 with the GNU Classpath Exception, which is available at
12 * https://www.gnu.org/software/classpath/license.html.
14 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17 package com
.sun
.mail
.mbox
;
20 import java
.io
.FilenameFilter
;
22 public interface FileInterface
{
24 * Gets the name of the file. This method does not include the
26 * @return the file name.
28 public String
getName();
31 * Gets the path of the file.
32 * @return the file path.
34 public String
getPath();
37 * Gets the absolute path of the file.
38 * @return the absolute file path.
40 public String
getAbsolutePath();
43 * Gets the official, canonical path of the File.
44 * @return canonical path
47 // public String getCanonicalPath();
50 * Gets the name of the parent directory.
51 * @return the parent directory, or null if one is not found.
53 public String
getParent();
56 * Returns a boolean indicating whether or not a file exists.
58 public boolean exists();
61 * Returns a boolean indicating whether or not a writable file
64 public boolean canWrite();
67 * Returns a boolean indicating whether or not a readable file
70 public boolean canRead();
73 * Returns a boolean indicating whether or not a normal file
76 public boolean isFile();
79 * Returns a boolean indicating whether or not a directory file
82 public boolean isDirectory();
85 * Returns a boolean indicating whether the file name is absolute.
87 public boolean isAbsolute();
90 * Returns the last modification time. The return value should
91 * only be used to compare modification dates. It is meaningless
92 * as an absolute time.
94 public long lastModified();
97 * Returns the length of the file.
102 * Creates a directory and returns a boolean indicating the
103 * success of the creation. Will return false if the directory already
106 public boolean mkdir();
109 * Renames a file and returns a boolean indicating whether
110 * or not this method was successful.
111 * @param dest the new file name
113 public boolean renameTo(File dest
);
116 * Creates all directories in this path. This method
117 * returns true if the target (deepest) directory was created,
118 * false if the target directory was not created (e.g., if it
119 * existed previously).
121 public boolean mkdirs();
124 * Lists the files in a directory. Works only on directories.
125 * @return an array of file names. This list will include all
126 * files in the directory except the equivalent of "." and ".." .
128 public String
[] list();
131 * Uses the specified filter to list files in a directory.
132 * @param filter the filter used to select file names
133 * @return the filter selected files in this directory.
134 * @see FilenameFilter
136 public String
[] list(FilenameFilter filter
);
139 * Deletes the specified file. Returns true
140 * if the file could be deleted.
142 public boolean delete();