View Javadoc
1   package org.codehaus.plexus.components.io.resources;
2   
3   /*
4    * Copyright 2007 The Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import javax.annotation.Nonnull;
20  
21  /**
22   * Default implementation of {@link PlexusIoResource}.
23   */
24  public abstract class AbstractPlexusIoResource implements PlexusIoResource {
25      private final String name;
26  
27      private final long lastModified, size;
28      private final boolean isFile, isDirectory, isExisting;
29  
30      protected AbstractPlexusIoResource(
31              @Nonnull String name,
32              long lastModified,
33              long size,
34              boolean isFile,
35              boolean isDirectory,
36              boolean isExisting) {
37          this.name = name;
38          this.lastModified = lastModified;
39          this.size = size;
40          this.isFile = isFile;
41          this.isDirectory = isDirectory;
42          this.isExisting = isExisting;
43      }
44  
45      public long getLastModified() {
46          return lastModified;
47      }
48  
49      @Nonnull
50      public String getName() {
51          return name;
52      }
53  
54      public long getSize() {
55          return size;
56      }
57  
58      public boolean isDirectory() {
59          return isDirectory;
60      }
61  
62      public boolean isExisting() {
63          return isExisting;
64      }
65  
66      public boolean isFile() {
67          return isFile;
68      }
69  
70      public boolean isSymbolicLink() {
71          return false;
72      }
73  }