1 16 package org.apache.commons.vfs.provider.local; 17 18 import org.apache.commons.vfs.FileName; 19 import org.apache.commons.vfs.FileSystemException; 20 import org.apache.commons.vfs.FileType; 21 22 27 public class GenericFileNameParser 28 extends LocalFileNameParser 29 { 30 private static final GenericFileNameParser INSTANCE = new GenericFileNameParser(); 31 32 37 public static GenericFileNameParser getInstance() 38 { 39 return INSTANCE; 40 } 41 42 45 protected String extractRootPrefix(final String uri, 46 final StringBuffer name) 47 throws FileSystemException 48 { 49 51 if (name.length() == 0 || name.charAt(0) != '/') 53 { 54 throw new FileSystemException("vfs.provider.local/not-absolute-file-name.error", uri); 55 } 56 57 return "/"; 59 } 60 61 66 protected FileName createFileName(String scheme, final String rootFile, final String path, final FileType type) 67 { 68 return new LocalFileName(scheme, "", path, type); 69 } 70 } 71 | Popular Tags |