diff options
Diffstat (limited to 'branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/DefaultFileContent.java')
-rw-r--r-- | branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/DefaultFileContent.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/DefaultFileContent.java b/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/DefaultFileContent.java new file mode 100644 index 0000000000..c1358327a9 --- /dev/null +++ b/branches/sca-java-1.x/modules/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/impl/DefaultFileContent.java @@ -0,0 +1,35 @@ +package org.apache.tuscany.sca.domain.search.impl; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +public class DefaultFileContent implements FileContent { + + final private URL url; + + public DefaultFileContent(URL url) { + this.url = url; + } + + public FileContent[] getChildren() { + return new FileContent[0]; + } + + public InputStream getInputStream() throws IOException { + return this.url.openStream(); + } + + public String getName() { + return this.url.getFile(); + } + + public String getPath() { + return this.url.getPath(); + } + + public boolean isLeaf() { + return false; + } + +} |