1 19 20 package com.sslexplorer.networkplaces.store.file; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 25 import org.apache.commons.vfs.FileObject; 26 27 import com.sslexplorer.networkplaces.AbstractNetworkPlaceMount; 28 import com.sslexplorer.policyframework.LaunchSession; 29 import com.sslexplorer.security.PasswordCredentials; 30 import com.sslexplorer.vfs.VFSStore; 31 import com.sslexplorer.vfs.utils.URI; 32 import com.sslexplorer.vfs.webdav.DAVUtilities; 33 34 40 public class FileMount extends AbstractNetworkPlaceMount { 41 42 48 public FileMount(LaunchSession launchSession, VFSStore store) { 49 super(launchSession, store); 50 } 51 52 55 public FileObject createVFSFileObject(String path, PasswordCredentials credentials) throws IOException { 56 URI uri = getRootVFSURI(); 57 uri.setPath(DAVUtilities.concatenatePaths(uri.getPath(), path)); 58 if(uri.getPath().startsWith("./")) { 59 FileObject root = getStore().getRepository().getFileSystemManager().resolveFile(new File (System.getProperty("user.dir")), uri.getPath().substring(2)); 60 return root; 61 } 62 else { 63 FileObject root = getStore().getRepository().getFileSystemManager().resolveFile(uri.toString()); 64 return root; 65 } 66 } 67 } | Popular Tags |