1 29 30 package com.caucho.jcr.file; 31 32 import com.caucho.config.ConfigException; 33 import com.caucho.jcr.base.BaseRepository; 34 import com.caucho.util.L10N; 35 import com.caucho.vfs.Path; 36 37 import javax.jcr.Credentials; 38 import javax.jcr.LoginException; 39 import javax.jcr.NoSuchWorkspaceException; 40 import javax.jcr.RepositoryException; 41 import javax.jcr.Session; 42 43 57 public class FileRepository extends BaseRepository { 58 private static final L10N L = new L10N(FileRepository.class); 59 60 private Path _root; 61 62 65 public void setRoot(Path root) 66 { 67 _root = root.createRoot(); 68 } 69 70 73 public Path getRoot() 74 { 75 return _root; 76 } 77 78 81 public void init() 82 throws ConfigException 83 { 84 if (_root == null) 85 throw new ConfigException(L.l("'root' property is required for FileRepository")); 86 } 87 88 91 public String getDescriptor(String key) 92 { 93 if (REP_NAME_DESC.equals(key)) 94 return "Resin File Repository"; 95 else 96 return super.getDescriptor(key); 97 } 98 99 106 public Session login(Credentials credentials, String workspaceName) 107 throws LoginException, 108 NoSuchWorkspaceException, 109 RepositoryException 110 { 111 return new FileSession(this); 112 } 113 } 114 | Popular Tags |