| 1 19 20 package com.sslexplorer.networkplaces.store.http; 21 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 25 import com.sslexplorer.networkplaces.AbstractNetworkPlaceMount; 26 import com.sslexplorer.networkplaces.AbstractNetworkPlaceStore; 27 import com.sslexplorer.policyframework.LaunchSession; 28 import com.sslexplorer.vfs.utils.URI; 29 import com.sslexplorer.vfs.utils.URI.MalformedURIException; 30 import com.sslexplorer.vfs.webdav.DAVUtilities; 31 32 33 39 public class HTTPStore extends AbstractNetworkPlaceStore { 40 final static Log log = LogFactory.getLog(HTTPStore.class); 41 42 45 public final static String HTTP_SCHEME = "http"; 46 47 50 public final static String HTTPS_SCHEME = "https"; 51 52 53 56 public HTTPStore() { 57 super(HTTP_SCHEME, "UTF-8"); 58 } 59 60 63 public URI createURIFromPath(String path) throws IllegalArgumentException { 64 try { 65 URI uri = new URI(DAVUtilities.processAndEncodeURI(path, getRepository().getSession())); 66 if (HTTP_SCHEME.equals(uri.getScheme()) || HTTPS_SCHEME.equals(uri.getScheme())){ 67 return uri; 68 } 69 } 70 catch (MalformedURIException e) { 71 } 72 throw new IllegalArgumentException (); 73 } 74 75 78 protected AbstractNetworkPlaceMount createMount(LaunchSession launchSession) throws Exception { 79 return new HTTPMount(launchSession, this); 80 } 81 } | Popular Tags |