de.intarsys.tools.locator.ZipFileLocatorFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isrt Show documentation
Show all versions of isrt Show documentation
The basic runtime tools and interfaces for intarsys components.
package de.intarsys.tools.locator;
import java.io.IOException;
import java.io.InputStream;
/**
* ! not yet functional !
*
* Locate resources contained within a zip file.
*
* Full syntax
*
* zip::#
*
* The zip locator itself may be any locator that can be resolved to an
* {@link InputStream}.
*/
public class ZipFileLocatorFactory extends CommonLocatorFactory {
public ILocator createLocator(String location) throws IOException {
int pos = location.lastIndexOf('#');
String zipLocation;
String path;
if (pos >= 0) {
zipLocation = location.substring(0, pos);
path = location.substring(pos + 1);
} else {
zipLocation = location;
path = "";
}
ILocator zipLocator = LocatorFactory.get().createLocator(zipLocation);
return new ZipFileLocator(zipLocator, path);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy