1 36 package org.ungoverned.oscar.installer.artifact; 37 38 import java.io.*; 39 40 import org.ungoverned.oscar.installer.Status; 41 import org.ungoverned.oscar.installer.StringProperty; 42 import org.ungoverned.oscar.installer.resource.ResourceLoader; 43 44 public class ResourceFileArtifact extends AbstractFileArtifact 45 { 46 public ResourceFileArtifact(StringProperty sourceName) 47 { 48 this(sourceName, sourceName); 49 } 50 51 public ResourceFileArtifact(StringProperty sourceName, StringProperty destName) 52 { 53 this(sourceName, destName, null); 54 } 55 56 public ResourceFileArtifact( 57 StringProperty sourceName, StringProperty destName, StringProperty destDir) 58 { 59 this(sourceName, destName, destDir, false); 60 } 61 62 public ResourceFileArtifact( 63 StringProperty sourceName, StringProperty destName, 64 StringProperty destDir, boolean localize) 65 { 66 super(sourceName, destName, destDir, localize); 67 } 68 69 public InputStream getInputStream(Status status) 70 throws IOException 71 { 72 return ResourceLoader.getResourceAsStream(getSourceName().getStringValue()); 73 } 74 75 public String toString() 76 { 77 return "RESOURCE FILE: " + getSourceName().getStringValue(); 78 } 79 } | Popular Tags |