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  {
26      private final String name;
27  
28      private final long lastModified, size;
29  
30      private final boolean isFile, isDirectory, isExisting;
31  
32      protected AbstractPlexusIoResource( @Nonnull String name, long lastModified, long size, boolean isFile,
33                                          boolean isDirectory, boolean isExisting )
34      {
35          this.name = name;
36          this.lastModified = lastModified;
37          this.size = size;
38          this.isFile = isFile;
39          this.isDirectory = isDirectory;
40          this.isExisting = isExisting;
41      }
42  
43      public long getLastModified()
44      {
45          return lastModified;
46      }
47  
48      @Nonnull
49      public String getName()
50      {
51          return name;
52      }
53  
54      public long getSize()
55      {
56          return size;
57      }
58  
59      public boolean isDirectory()
60      {
61          return isDirectory;
62      }
63  
64      public boolean isExisting()
65      {
66          return isExisting;
67      }
68  
69      public boolean isFile()
70      {
71          return isFile;
72      }
73  
74      public boolean isSymbolicLink()
75      {
76          return false;
77      }
78  }