View Javadoc

    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  package org.apache.commons.vfs;
    18
    19  /***
    20   * An enumerated type representing the capabilities of files and file systems.
    21   *
    22   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    23   * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
    24   */
    25  public final class Capability
    26  {
    27      /***
    28       * File content can be read.
    29       */
    30      public static final Capability READ_CONTENT = new Capability("READ_CONTENT");
    31
    32      /***
    33       * File content can be written.
    34       */
    35      public static final Capability WRITE_CONTENT = new Capability("WRITE_CONTENT");
    36
    37      /***
    38       * File content can be read in random mode.<br>
    39       */
    40      public static final Capability RANDOM_ACCESS_READ = new Capability("RANDOM_ACCESS_READ");
    41
    42      /***
    43       * File content can be written in random mode.<br>
    44       */
    45      public static final Capability RANDOM_ACCESS_WRITE = new Capability("RANDOM_ACCESS_WRITE");
    46
    47      /***
    48       * File content can be appended.
    49       */
    50      public static final Capability APPEND_CONTENT = new Capability("APPEND_CONTENT");
    51
    52      /***
    53       * File attributes are supported.
    54       */
    55      public static final Capability ATTRIBUTES = new Capability("ATTRIBUTES");
    56
    57      /***
    58       * File last-modified time is supported.
    59       */
    60      public static final Capability LAST_MODIFIED = new Capability("LAST_MODIFIED");
    61
    62      /***
    63       * File get last-modified time is supported.
    64       */
    65      public static final Capability GET_LAST_MODIFIED = new Capability("GET_LAST_MODIFIED");
    66
    67      /***
    68       * File set last-modified time is supported.
    69       */
    70      public static final Capability SET_LAST_MODIFIED_FILE = new Capability("SET_LAST_MODIFIED_FILE");
    71
    72      /***
    73       * folder set last-modified time is supported.
    74       */
    75      public static final Capability SET_LAST_MODIFIED_FOLDER = new Capability("SET_LAST_MODIFIED_FOLDER");
    76
    77      /***
    78       * File content signing is supported.
    79       */
    80      public static final Capability SIGNING = new Capability("SIGNING");
    81
    82      /***
    83       * Files can be created.
    84       */
    85      public static final Capability CREATE = new Capability("CREATE");
    86
    87      /***
    88       * Files can be deleted.
    89       */
    90      public static final Capability DELETE = new Capability("DELETE");
    91
    92      /***
    93       * Files can be renamed.
    94       */
    95      public static final Capability RENAME = new Capability("RENAME");
    96
    97      /***
    98       * The file type can be determined.
    99       */
    100     public static final Capability GET_TYPE = new Capability("GET_TYPE");
    101
    102     /***
    103      * Children of files can be listed.
    104      */
    105     public static final Capability LIST_CHILDREN = new Capability("LIST_CHILDREN");
    106
    107     /***
    108      * URI are supported.  Files without this capability use URI that do not
    109      * globally and uniquely identify the file.
    110      */
    111     public static final Capability URI = new Capability("URI");
    112
    113     /***
    114      * File system attributes are supported.
    115      */
    116     public static final Capability FS_ATTRIBUTES = new Capability("FS_ATTRIBUTE");
    117
    118     /***
    119      * Junctions are supported.
    120      */
    121     public static final Capability JUNCTIONS = new Capability("JUNCTIONS");
    122
    123     /***
    124      * The set of attributes defined by the Jar manifest specification are
    125      * supported.  The attributes aren't necessarily stored in a manifest file.
    126      */
    127     public static final Capability MANIFEST_ATTRIBUTES = new Capability("MANIFEST_ATTRIBUTES");
    128
    129     /***
    130      * The provider itself do not provide a filesystem. It simply resolves a full name
    131      * and dispatches the request back to the filesystemmanager.<br>
    132      * A provider with this capability cant tell much about the capabilities about the
    133      * finally used filesystem in advance.
    134      */
    135     public static final Capability DISPATCHER = new Capability("DISPATCHER");
    136
    137     /***
    138      * A compressed filesystem is a filesystem which use compression.
    139      */
    140     public static final Capability COMPRESS = new Capability("COMPRESS");
    141
    142     /***
    143      * A virtual filesystem can be an archive like tar or zip.
    144      */
    145     public static final Capability VIRTUAL = new Capability("VIRTUAL");
    146
    147     private final String name;
    148
    149     private Capability(final String name)
    150     {
    151         this.name = name;
    152     }
    153
    154     public String toString()
    155     {
    156         return name;
    157     }
    158 }