BrightSide Workbench Full Report + Source Code
org.turro.wd.files.WorkingDirectory Class Reference
Inheritance diagram for org.turro.wd.files.WorkingDirectory:
Collaboration diagram for org.turro.wd.files.WorkingDirectory:

Public Member Functions

 WorkingDirectory (String bbUser, String bbHost, String bbPort, String bbContext)
 
String getBbContext ()
 
String getBbHost ()
 
String getBbPort ()
 
String getBbUser ()
 
void initialize (String bbCreateDir, String bbCreatePath) throws ParseException
 
void reload () throws ParseException
 
String getSystemName ()
 
void saveCache ()
 
- Public Member Functions inherited from org.turro.wd.files.Directory
DirectorySet getDirs ()
 
void setDirs (DirectorySet dirs)
 
WorkFileSet getFiles ()
 
void setFiles (WorkFileSet files)
 
String getName ()
 
void setName (String name)
 
Directory getParent ()
 
void setParent (Directory parent)
 
String getAbsolutePath ()
 
String getPath ()
 
String getServerPath ()
 
void setServerPath (String serverPath)
 
String getSystemPath ()
 
File getSystemFile ()
 
String getHost ()
 
Integer getPort ()
 
String getContext ()
 
String getUser ()
 
boolean isRoot ()
 
boolean isWorkingDirectory ()
 
boolean isExistsOnServer ()
 
boolean isUpdatable ()
 
Directory addDirectory (String name)
 
WorkFile addFile (String name)
 
int getnCommits ()
 
int getnFiles ()
 
int getnUpdates ()
 
int compareTo (Directory o)
 
Collection< String > doQueryFolders ()
 
Collection< ServerFiledoQueryFiles ()
 

Static Public Attributes

static final String WD_ROOT = "/BBWorkDir"
 

Additional Inherited Members

- Protected Member Functions inherited from org.turro.wd.files.Directory
void countFiles () throws ParseException
 
void readXML (Element root) throws ParseException
 
void writeXML (Element root)
 
boolean checkExisting ()
 
void loadSystemFiles ()
 
void loadServerFiles ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 38 of file WorkingDirectory.java.

Constructor & Destructor Documentation

◆ WorkingDirectory()

org.turro.wd.files.WorkingDirectory.WorkingDirectory ( String  bbUser,
String  bbHost,
String  bbPort,
String  bbContext 
)

Definition at line 48 of file WorkingDirectory.java.

48  {
49  this.bbUser = bbUser;
50  this.bbHost = bbHost;
51  this.bbPort = bbPort;
52  this.bbContext = bbContext;
53  }

Member Function Documentation

◆ getBbContext()

String org.turro.wd.files.WorkingDirectory.getBbContext ( )

Definition at line 55 of file WorkingDirectory.java.

55  {
56  return bbContext == null ? "" : bbContext;
57  }

◆ getBbHost()

String org.turro.wd.files.WorkingDirectory.getBbHost ( )

Definition at line 59 of file WorkingDirectory.java.

59  {
60  return bbHost;
61  }

◆ getBbPort()

String org.turro.wd.files.WorkingDirectory.getBbPort ( )

Definition at line 63 of file WorkingDirectory.java.

63  {
64  return bbPort;
65  }

◆ getBbUser()

String org.turro.wd.files.WorkingDirectory.getBbUser ( )

Definition at line 67 of file WorkingDirectory.java.

67  {
68  return bbUser;
69  }

◆ getSystemName()

String org.turro.wd.files.WorkingDirectory.getSystemName ( )

Reimplemented from org.turro.wd.files.Directory.

Definition at line 109 of file WorkingDirectory.java.

109  {
110  return wdHome.getAbsolutePath();
111  }

◆ initialize()

void org.turro.wd.files.WorkingDirectory.initialize ( String  bbCreateDir,
String  bbCreatePath 
) throws ParseException

Definition at line 71 of file WorkingDirectory.java.

71  {
72  wdHome = new File(System.getProperty("user.home") + WD_ROOT + "/" + bbHost);
73  if(!wdHome.exists()) {
74  wdHome.mkdirs();
75  }
76  wdInternal = new File(wdHome.getAbsolutePath() + WD_CONF_ROOT);
77  if(!wdInternal.exists()) {
78  wdInternal.mkdirs();
79  }
80  wdCache = new File(wdInternal.getAbsolutePath() + WD_CACHE);
81  initializeCache();
82  checkExisting();
84  if(bbCreateDir != null) {
85  Directory d = getDirs().getDir(bbCreateDir);
86  if(d == null) {
87  d = addDirectory(bbCreateDir);
88  d.setServerPath(bbCreatePath);
89  d.getSystemFile().mkdirs();
90  }
91  }
93  saveCache();
94  countFiles();
95  }
Directory getDir(String dir)
Directory addDirectory(String name)
Definition: Directory.java:193
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reload()

void org.turro.wd.files.WorkingDirectory.reload ( ) throws ParseException

Definition at line 97 of file WorkingDirectory.java.

97  {
98  getDirs().clear();
99  getFiles().clear();
100  initializeCache();
101  checkExisting();
102  loadSystemFiles();
103  loadServerFiles();
104  saveCache();
105  countFiles();
106  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveCache()

void org.turro.wd.files.WorkingDirectory.saveCache ( )

Definition at line 128 of file WorkingDirectory.java.

128  {
129  Document doc = new Document(new Element("bb-working-directory"));
130  writeXML(doc.getRootElement());
131  try {
132  OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(wdCache), "UTF-8");
133  Format fm = Format.getPrettyFormat();
134  fm.setEncoding("UTF-8");
135  XMLOutputter xo = new XMLOutputter(fm);
136  xo.output(doc, fw);
137  fw.close();
138  } catch (IOException ex) {
139  Logger.getLogger(WorkingDirectory.class.getName()).log(Level.SEVERE, null, ex);
140  }
141  }
void writeXML(Element root)
Definition: Directory.java:257
WorkingDirectory(String bbUser, String bbHost, String bbPort, String bbContext)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ WD_ROOT

final String org.turro.wd.files.WorkingDirectory.WD_ROOT = "/BBWorkDir"
static

Definition at line 41 of file WorkingDirectory.java.


The documentation for this class was generated from the following file: