- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 39 of file Directory.java.
◆ addDirectory()
Directory org.turro.wd.files.Directory.addDirectory |
( |
String |
name | ) |
|
Definition at line 193 of file Directory.java.
194 Directory wdir =
new Directory();
195 wdir.setParent(
this);
196 wdir.setName(name ==
null ?
"wdtmp" : name);
◆ addFile()
WorkFile org.turro.wd.files.Directory.addFile |
( |
String |
name | ) |
|
Definition at line 201 of file Directory.java.
202 WorkFile wfile =
new WorkFile();
203 wfile.setParent(
this);
204 wfile.setName(name ==
null ?
"wdtmp" : name);
◆ checkExisting()
boolean org.turro.wd.files.Directory.checkExisting |
( |
| ) |
|
|
protected |
Definition at line 278 of file Directory.java.
281 ProgressSheet.nextProgress(dir.getName());
282 if (dir !=
null && dir.exists()) {
283 Iterator<Directory> itd =
getDirs().iterator();
284 while (itd.hasNext()) {
285 if (!itd.next().checkExisting()) {
boolean isWorkingDirectory()
◆ compareTo()
int org.turro.wd.files.Directory.compareTo |
( |
Directory |
o | ) |
|
◆ countFiles()
void org.turro.wd.files.Directory.countFiles |
( |
| ) |
throws ParseException |
|
protected |
Definition at line 221 of file Directory.java.
222 nUpdates = nCommits = nFiles = 0;
225 nUpdates += d.nUpdates;
226 nCommits += d.nCommits;
231 if(wf.isDownloadable()) {
233 }
else if(wf.isUploadable()) {
◆ doQueryFiles()
Collection<ServerFile> org.turro.wd.files.Directory.doQueryFiles |
( |
| ) |
|
Definition at line 375 of file Directory.java.
378 GetQuery getQuery =
new GetQuery(
380 getContext() +
"/pservice/queryFiles",
false);
381 getQuery.getParameters().put(
"user",
getUser());
383 getQuery.setSerializer(
new BinarySerializer());
384 return (Collection<ServerFile>) getQuery.execute();
385 }
catch (QueryException ex) {
386 Logger.getLogger(Directory.class.getName()).log(Level.SEVERE,
null, ex);
389 return new ArrayList<ServerFile>();
◆ doQueryFolders()
Collection<String> org.turro.wd.files.Directory.doQueryFolders |
( |
| ) |
|
Definition at line 358 of file Directory.java.
361 GetQuery getQuery =
new GetQuery(
363 getContext() +
"/pservice/queryFolders",
false);
364 getQuery.getParameters().put(
"user",
getUser());
366 getQuery.setSerializer(
new BinarySerializer());
367 return (Collection<String>) getQuery.execute();
368 }
catch (QueryException ex) {
369 Logger.getLogger(Directory.class.getName()).log(Level.SEVERE,
null, ex);
372 return new ArrayList<String>();
◆ getAbsolutePath()
String org.turro.wd.files.Directory.getAbsolutePath |
( |
| ) |
|
Definition at line 79 of file Directory.java.
81 Directory current =
this;
82 while (current !=
null) {
83 if (current.getPath() !=
null) {
84 ap = current.getPath() + (ap ==
null ?
"" :
"/" + ap);
86 current = current.getParent();
◆ getContext()
String org.turro.wd.files.Directory.getContext |
( |
| ) |
|
Definition at line 159 of file Directory.java.
160 Directory current =
this;
161 while (!(current instanceof WorkingDirectory)) {
162 current = current.getParent();
164 return ((WorkingDirectory) current).getBbContext();
◆ getDirs()
◆ getFiles()
◆ getHost()
String org.turro.wd.files.Directory.getHost |
( |
| ) |
|
Definition at line 142 of file Directory.java.
143 Directory current =
this;
144 while (!(current instanceof WorkingDirectory)) {
145 current = current.getParent();
147 return ((WorkingDirectory) current).getBbHost();
◆ getName()
String org.turro.wd.files.Directory.getName |
( |
| ) |
|
◆ getnCommits()
int org.turro.wd.files.Directory.getnCommits |
( |
| ) |
|
◆ getnFiles()
int org.turro.wd.files.Directory.getnFiles |
( |
| ) |
|
◆ getnUpdates()
int org.turro.wd.files.Directory.getnUpdates |
( |
| ) |
|
◆ getParent()
Directory org.turro.wd.files.Directory.getParent |
( |
| ) |
|
◆ getPath()
String org.turro.wd.files.Directory.getPath |
( |
| ) |
|
◆ getPort()
Integer org.turro.wd.files.Directory.getPort |
( |
| ) |
|
Definition at line 150 of file Directory.java.
151 Directory current =
this;
152 while (!(current instanceof WorkingDirectory)) {
153 current = current.getParent();
155 String port = ((WorkingDirectory) current).getBbPort();
156 return port ==
null ? 80 :
new Integer(port);
◆ getServerPath()
String org.turro.wd.files.Directory.getServerPath |
( |
| ) |
|
◆ getSystemFile()
File org.turro.wd.files.Directory.getSystemFile |
( |
| ) |
|
◆ getSystemName()
String org.turro.wd.files.Directory.getSystemName |
( |
| ) |
|
Reimplemented in org.turro.wd.files.WorkingDirectory.
Definition at line 107 of file Directory.java.
109 .replaceAll(
"\\|",
"-")
110 .replaceAll(
"\\<",
"-")
111 .replaceAll(
"\\>",
"-")
112 .replaceAll(
"\\:",
"-")
113 .replaceAll(
"\"",
"'")
114 .replaceAll(
"\\\\",
"-")
115 .replaceAll(
"\\/",
"-")
116 .replaceAll(
"\\*",
"-")
117 .replaceAll(
"\\&",
"i")
118 .replaceAll(
"\\%",
"-")
119 .replaceAll(
"\\?",
"-");
◆ getSystemPath()
String org.turro.wd.files.Directory.getSystemPath |
( |
| ) |
|
Definition at line 122 of file Directory.java.
124 Directory current =
this;
125 while (current !=
null) {
126 if (current.getSystemName() !=
null) {
127 sp = current.getSystemName() + (sp ==
null ?
"" :
"/" + sp);
128 current = current.getParent();
◆ getUser()
String org.turro.wd.files.Directory.getUser |
( |
| ) |
|
Definition at line 167 of file Directory.java.
168 Directory current =
this;
169 while (!(current instanceof WorkingDirectory)) {
170 current = current.getParent();
172 return ((WorkingDirectory) current).getBbUser();
◆ isExistsOnServer()
boolean org.turro.wd.files.Directory.isExistsOnServer |
( |
| ) |
|
◆ isRoot()
boolean org.turro.wd.files.Directory.isRoot |
( |
| ) |
|
Definition at line 175 of file Directory.java.
176 return parent instanceof WorkingDirectory;
◆ isUpdatable()
boolean org.turro.wd.files.Directory.isUpdatable |
( |
| ) |
|
◆ isWorkingDirectory()
boolean org.turro.wd.files.Directory.isWorkingDirectory |
( |
| ) |
|
Definition at line 179 of file Directory.java.
180 return this instanceof WorkingDirectory;
◆ loadServerFiles()
void org.turro.wd.files.Directory.loadServerFiles |
( |
| ) |
|
|
protected |
Definition at line 326 of file Directory.java.
327 for (Directory d :
getDirs()) {
331 ProgressSheet.nextProgress(folder);
332 if (!
getDirs().containsDir(folder)) {
334 nd.loadServerFiles();
340 wf =
addFile(sf.getFileName());
342 ProgressSheet.nextProgress(sf.getFileName());
343 wf.setDownModification(sf.getModification());
344 wf.setServerOwner(sf.getOwner());
345 wf.setServerSize(sf.getFileSize());
346 wf.setServerLocked(sf.isLocked());
347 wf.setServerLocker(sf.getLocker());
Collection< String > doQueryFolders()
Directory addDirectory(String name)
WorkFile addFile(String name)
Collection< ServerFile > doQueryFiles()
WorkFile getFile(String file)
◆ loadSystemFiles()
void org.turro.wd.files.Directory.loadSystemFiles |
( |
| ) |
|
|
protected |
Definition at line 301 of file Directory.java.
303 for (File file : dir.listFiles()) {
304 if(file.getName().startsWith(
".") ||
305 file.getName().endsWith(
"~") ||
309 ProgressSheet.nextProgress(file.getName());
310 if (file.isDirectory()) {
316 }
else if (file.isFile()) {
Directory getDir(String dir)
◆ readXML()
void org.turro.wd.files.Directory.readXML |
( |
Element |
root | ) |
throws ParseException |
|
protected |
Definition at line 239 of file Directory.java.
240 if (root.getAttributeValue(
"name") !=
null) {
241 setName(root.getAttributeValue(
"name"));
243 if (root.getAttributeValue(
"serverPath") !=
null) {
244 setServerPath(decryptString(root.getAttributeValue(
"serverPath")));
247 for (Element el : (List<Element>) root.getChildren(
"wdir")) {
251 for (Element el : (List<Element>) root.getChildren(
"wfile")) {
252 WorkFile wfile =
addFile(
null);
void setName(String name)
void setServerPath(String serverPath)
◆ setDirs()
void org.turro.wd.files.Directory.setDirs |
( |
DirectorySet |
dirs | ) |
|
◆ setFiles()
void org.turro.wd.files.Directory.setFiles |
( |
WorkFileSet |
files | ) |
|
◆ setName()
void org.turro.wd.files.Directory.setName |
( |
String |
name | ) |
|
◆ setParent()
void org.turro.wd.files.Directory.setParent |
( |
Directory |
parent | ) |
|
◆ setServerPath()
void org.turro.wd.files.Directory.setServerPath |
( |
String |
serverPath | ) |
|
◆ writeXML()
void org.turro.wd.files.Directory.writeXML |
( |
Element |
root | ) |
|
|
protected |
Definition at line 257 of file Directory.java.
260 el =
new Element(
"wdir");
261 el.setAttribute(
"name",
getName());
263 el.setAttribute(
"serverPath", encryptString(
getServerPath()));
270 for (Directory d : dirs) {
273 for (WorkFile f : files) {
The documentation for this class was generated from the following file: