View Javadoc

1   /*
2    * REPOWEB, repository manager.
3    *
4    * Terms of license - http://opensource.org/licenses/apachepl.php
5    */
6   package org.repoweb.model.file;
7   import java.io.File;
8   import java.io.FileInputStream;
9   import java.io.FileNotFoundException;
10  import java.io.InputStream;
11  import org.repoweb.model.Artifact;
12  import org.repoweb.model.common.AbstractArtifact;
13  /***
14   * Implementation of an artifact for file system.
15   */
16  class FArtifact extends AbstractArtifact {
17      private Artifact _pom;
18  
19      FArtifact(File file) throws BadArtifactFileException {
20          super(file);
21      }
22  
23      public long getLength() {
24          return getFile().length();
25      }
26  
27  
28      public InputStream getInputStream() throws FileNotFoundException {
29          return new FileInputStream(getFile());
30      }
31  
32  
33      public Artifact getPom() {
34          return _pom;
35      }
36  
37  
38      void setPom(Artifact pom) {
39          _pom = pom;
40      }
41  }