From b4192c7a88bad111bebbd42d391d6e729c8617d6 Mon Sep 17 00:00:00 2001 From: olamedia Date: Fri, 28 Sep 2012 18:46:42 +0600 Subject: initial --- src/ru/olamedia/asset/Asset.java | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/ru/olamedia/asset/Asset.java (limited to 'src/ru/olamedia/asset/Asset.java') diff --git a/src/ru/olamedia/asset/Asset.java b/src/ru/olamedia/asset/Asset.java new file mode 100644 index 0000000..a420c10 --- /dev/null +++ b/src/ru/olamedia/asset/Asset.java @@ -0,0 +1,29 @@ +package ru.olamedia.asset; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +public class Asset { + protected URL url; + + public boolean inJar() { + return url.toString().startsWith("file:jar:"); + } + + public Asset(URL url) { + this.url = url; + } + + public URL getURL() { + return url; + } + + public InputStream getInputStream() throws IOException { + return url.openStream(); + } + + public String getFile() { + return url.getFile(); + } +} -- cgit v1.2.3