All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.intarsys.tools.locator.ZipFileLocatorFactory Maven / Gradle / Ivy

There is a newer version: 4.11
Show newest version
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