package at.gv.egiz.eaaf.modules.pvp2.impl.opensaml; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URL; import net.shibboleth.utilities.java.support.resource.Resource; /** * Adapter that connects a Spring {@link org.springframework.core.io.Resource} * to a {@link Resource}. * * @author tlenz * */ public class OpenSaml3ResourceAdapter implements Resource { private final org.springframework.core.io.Resource internalResource; public OpenSaml3ResourceAdapter(org.springframework.core.io.Resource resource) { this.internalResource = resource; } @Override public boolean exists() { return internalResource.exists(); } @Override public boolean isReadable() { return internalResource.isReadable(); } @Override public boolean isOpen() { return internalResource.isOpen(); } @Override public URL getURL() throws IOException { return internalResource.getURL(); } @Override public URI getURI() throws IOException { return internalResource.getURI(); } @Override public File getFile() throws IOException { return internalResource.getFile(); } @Override public InputStream getInputStream() throws IOException { return internalResource.getInputStream(); } @Override public long contentLength() throws IOException { return internalResource.contentLength(); } @Override public long lastModified() throws IOException { return internalResource.lastModified(); } @Override public Resource createRelativeResource(String relativePath) throws IOException { throw new IOException("This method is not supperted by this adapter"); } @Override public String getFilename() { return internalResource.getFilename(); } @Override public String getDescription() { return internalResource.getDescription(); } }