001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.commons.vfs;
018:
019: /**
020: * An enumerated type representing the capabilities of files and file systems.
021: *
022: * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
023: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
024: */
025: public final class Capability {
026: /**
027: * File content can be read.
028: */
029: public static final Capability READ_CONTENT = new Capability(
030: "READ_CONTENT");
031:
032: /**
033: * File content can be written.
034: */
035: public static final Capability WRITE_CONTENT = new Capability(
036: "WRITE_CONTENT");
037:
038: /**
039: * File content can be read in random mode.<br>
040: */
041: public static final Capability RANDOM_ACCESS_READ = new Capability(
042: "RANDOM_ACCESS_READ");
043:
044: /**
045: * File content can be written in random mode.<br>
046: */
047: public static final Capability RANDOM_ACCESS_WRITE = new Capability(
048: "RANDOM_ACCESS_WRITE");
049:
050: /**
051: * File content can be appended.
052: */
053: public static final Capability APPEND_CONTENT = new Capability(
054: "APPEND_CONTENT");
055:
056: /**
057: * File attributes are supported.
058: */
059: public static final Capability ATTRIBUTES = new Capability(
060: "ATTRIBUTES");
061:
062: /**
063: * File last-modified time is supported.
064: */
065: public static final Capability LAST_MODIFIED = new Capability(
066: "LAST_MODIFIED");
067:
068: /**
069: * File get last-modified time is supported.
070: */
071: public static final Capability GET_LAST_MODIFIED = new Capability(
072: "GET_LAST_MODIFIED");
073:
074: /**
075: * File set last-modified time is supported.
076: */
077: public static final Capability SET_LAST_MODIFIED_FILE = new Capability(
078: "SET_LAST_MODIFIED_FILE");
079:
080: /**
081: * folder set last-modified time is supported.
082: */
083: public static final Capability SET_LAST_MODIFIED_FOLDER = new Capability(
084: "SET_LAST_MODIFIED_FOLDER");
085:
086: /**
087: * File content signing is supported.
088: */
089: public static final Capability SIGNING = new Capability("SIGNING");
090:
091: /**
092: * Files can be created.
093: */
094: public static final Capability CREATE = new Capability("CREATE");
095:
096: /**
097: * Files can be deleted.
098: */
099: public static final Capability DELETE = new Capability("DELETE");
100:
101: /**
102: * Files can be renamed.
103: */
104: public static final Capability RENAME = new Capability("RENAME");
105:
106: /**
107: * The file type can be determined.
108: */
109: public static final Capability GET_TYPE = new Capability("GET_TYPE");
110:
111: /**
112: * Children of files can be listed.
113: */
114: public static final Capability LIST_CHILDREN = new Capability(
115: "LIST_CHILDREN");
116:
117: /**
118: * URI are supported. Files without this capability use URI that do not
119: * globally and uniquely identify the file.
120: */
121: public static final Capability URI = new Capability("URI");
122:
123: /**
124: * File system attributes are supported.
125: */
126: public static final Capability FS_ATTRIBUTES = new Capability(
127: "FS_ATTRIBUTE");
128:
129: /**
130: * Junctions are supported.
131: */
132: public static final Capability JUNCTIONS = new Capability(
133: "JUNCTIONS");
134:
135: /**
136: * The set of attributes defined by the Jar manifest specification are
137: * supported. The attributes aren't necessarily stored in a manifest file.
138: */
139: public static final Capability MANIFEST_ATTRIBUTES = new Capability(
140: "MANIFEST_ATTRIBUTES");
141:
142: /**
143: * The provider itself do not provide a filesystem. It simply resolves a full name
144: * and dispatches the request back to the filesystemmanager.<br>
145: * A provider with this capability cant tell much about the capabilities about the
146: * finally used filesystem in advance.
147: */
148: public static final Capability DISPATCHER = new Capability(
149: "DISPATCHER");
150:
151: /**
152: * A compressed filesystem is a filesystem which use compression.
153: */
154: public static final Capability COMPRESS = new Capability("COMPRESS");
155:
156: /**
157: * A virtual filesystem can be an archive like tar or zip.
158: */
159: public static final Capability VIRTUAL = new Capability("VIRTUAL");
160:
161: private final String name;
162:
163: private Capability(final String name) {
164: this .name = name;
165: }
166:
167: public String toString() {
168: return name;
169: }
170: }
|