1 19 20 package com.sslexplorer.networkplaces; 21 22 import java.io.IOException ; 23 24 import org.apache.commons.vfs.FileObject; 25 26 import com.sslexplorer.policyframework.LaunchSession; 27 import com.sslexplorer.security.PasswordCredentials; 28 import com.sslexplorer.vfs.VFSStore; 29 import com.sslexplorer.vfs.utils.URI; 30 import com.sslexplorer.vfs.webdav.DAVUtilities; 31 32 38 public class DefaultArchiveMount extends AbstractNetworkPlaceMount { 39 40 46 public DefaultArchiveMount(LaunchSession launchSession, VFSStore store) { 47 super(launchSession, store); 48 setReadOnly(true); 49 } 50 51 54 public FileObject createVFSFileObject(String path, PasswordCredentials credentials) throws IOException { 55 URI uri = getRootVFSURI(); 56 String uriPath = uri.getPath(); 57 if(!uriPath.contains("!")) { 58 uriPath = DAVUtilities.stripTrailingSlash(uriPath) + "!/./"; 59 } 60 uriPath = uriPath.replace('\\', '/'); 61 if(uriPath.matches("^[a-zA-Z]?\\:/")) { 62 63 } 64 String newPath = DAVUtilities.concatenatePaths(uriPath, path); 65 uri.setPath(newPath); 66 FileObject root = getStore().getRepository().getFileSystemManager().resolveFile(uri.toString()); 67 return root; 68 } 69 } | Popular Tags |