1 16 package org.apache.commons.vfs.provider.smb; 17 18 import org.apache.commons.vfs.Capability; 19 import org.apache.commons.vfs.FileName; 20 import org.apache.commons.vfs.FileSystem; 21 import org.apache.commons.vfs.FileSystemException; 22 import org.apache.commons.vfs.FileSystemOptions; 23 import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider; 24 import org.apache.commons.vfs.provider.FileProvider; 25 26 import java.util.Arrays ; 27 import java.util.Collection ; 28 import java.util.Collections ; 29 30 35 public class SmbFileProvider 36 extends AbstractOriginatingFileProvider 37 implements FileProvider 38 { 39 protected final static Collection capabilities = Collections.unmodifiableCollection(Arrays.asList(new Capability[] 40 { 41 Capability.CREATE, 42 Capability.DELETE, 43 Capability.RENAME, 44 Capability.GET_TYPE, 45 Capability.GET_LAST_MODIFIED, 46 Capability.LIST_CHILDREN, 47 Capability.READ_CONTENT, 48 Capability.URI, 49 Capability.WRITE_CONTENT, 50 Capability.APPEND_CONTENT, 51 Capability.RANDOM_ACCESS_READ, 52 Capability.RANDOM_ACCESS_WRITE 53 })); 54 55 public SmbFileProvider() 56 { 57 super(); 58 setFileNameParser(SmbFileNameParser.getInstance()); 59 } 60 61 64 protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions) 65 throws FileSystemException 66 { 67 return new SmbFileSystem(name, fileSystemOptions); 68 } 69 70 public Collection getCapabilities() 71 { 72 return capabilities; 73 } 74 } 75 | Popular Tags |