Changeset 5785
- Timestamp:
- 2003-11-05T13:46:44+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r5581 r5785 301 301 302 302 /** Retrieve the value of the named property as a Dimension. */ 303 publicDimension getDimension(String property, boolean general) {303 /* private Dimension getDimension(String property, boolean general) { 304 304 Dimension result = new Dimension(100, 100); // Default 305 305 try { … … 315 315 } 316 316 return result; 317 } 317 } */ 318 318 319 319 /** Retrieve the value of the named property as a FontUIResource. */ … … 512 512 513 513 /** Set the named property, from the specified configuration, using the given Dimension value. */ 514 publicvoid setDimension(String property, boolean general, Dimension value) {514 /* private void setDimension(String property, boolean general, Dimension value) { 515 515 StringBuffer text = new StringBuffer(""); 516 516 text.append(value.width); … … 518 518 text.append(value.height); 519 519 setString(property, general, text.toString()); 520 } 520 } */ 521 521 522 522 /** Set the named property, from the specified configuration, using the given Font value. */ … … 541 541 542 542 /** Set the named property, from the specified configuration, using the given integer value. */ 543 publicvoid setInt(String property, boolean general, int value) {543 /* private void setInt(String property, boolean general, int value) { 544 544 setString(property, general, String.valueOf(value)); 545 } 545 } */ 546 546 547 547 /** Set the named property, from the specified configuration, using the given Locale value. */ -
trunk/gli/src/org/greenstone/gatherer/Dictionary.java
r5597 r5785 205 205 206 206 /** Remove the component from our registered components list. */ 207 publicvoid deregister(Object component) {207 /* private void deregister(Object component) { 208 208 remove(component); 209 } 209 } */ 210 210 211 211 public void destroy() { -
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r5593 r5785 386 386 * @see org.greenstone.gatherer.gui.GUIManager 387 387 */ 388 publicJFrame getFrame() {388 /* private JFrame getFrame() { 389 389 return g_man; 390 } 390 } */ 391 391 392 392 /** Method to retrieve a reference to the metadata set manager class. This is then used to create the 'metadataset' commands in the collection configuration file. … … 394 394 * @see org.greenstone.gatherer.collection.CollectionManager 395 395 */ 396 publicMetadataSetManager getMSM() {396 /* private MetadataSetManager getMSM() { 397 397 if(c_man != null && c_man.getCollection() != null && c_man.getCollection().msm != null) { 398 398 return c_man.getCollection().msm; 399 399 } 400 400 return null; 401 } 401 } */ 402 402 403 403 /** Used to 'spawn' a new child application when a file is double clicked. … … 658 658 * @see javax.swing.UIManager 659 659 */ 660 static p ublic void setUIFont (FontUIResource f, FontUIResource ttf){660 static private void setUIFont(FontUIResource f, FontUIResource ttf) { 661 661 // sets the default font for all Swing components. 662 662 // ex. … … 672 672 // Now set the tooltip font to some fixed width font 673 673 UIManager.put("ToolTip.font", ttf); 674 674 } 675 675 676 676 /** Loads the configuration file if one exists. Otherwise it creates a new one. Currently uses serialization. -
trunk/gli/src/org/greenstone/gatherer/WGet.java
r5581 r5785 115 115 * harvested. 116 116 */ 117 publicvoid convertLinks() {117 /* private void convertLinks() { 118 118 Vector args = new Vector(); 119 119 Vector files = new Vector(); … … 124 124 args.add("debug.txt"); 125 125 args.add("-P"); 126 args.add("/tmp/"); 126 args.add("/tmp/"); */ 127 127 128 128 // Downloaded urls (two entries for each record). The pattern here is: … … 160 160 //wren(args.size(), args.toArray(), urls.size(), urls.toArray(), 161 161 // files.size(), files.toArray()); 162 }162 /* } */ 163 163 164 164 /** This method is called to delete a certain job from the queue. -
trunk/gli/src/org/greenstone/gatherer/cdm/Classifier.java
r5590 r5785 279 279 } 280 280 281 publicString getOldPositionString() {281 /* private String getOldPositionString() { 282 282 return old_position_string; 283 } 283 } */ 284 284 285 285 /** Generate the string showing this classifiers position. */ -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
r5649 r5785 160 160 * @return The files absolute path as a <strong>String</strong>. 161 161 */ 162 publicString getFilename() {162 /* private String getFilename() { 163 163 return collect_config.getFile().getAbsolutePath(); 164 } 164 } */ 165 165 166 166 /** Cause the current collection configuration to be written out to disk. -
trunk/gli/src/org/greenstone/gatherer/cdm/CommandTokenizer.java
r5590 r5785 67 67 } 68 68 69 publicint getLastType() {69 /* private int getLastType() { 70 70 return last_type; 71 } 71 } */ 72 72 73 publicboolean isComment() {73 /* private boolean isComment() { 74 74 return (last_type == DOUBLE_QUOTE_ENCLOSED || last_type == QUOTE_ENCLOSED); 75 } 75 } */ 76 76 77 77 /** Method to retrieve the next token from the command, taking care to group tokens enclosed in speech marks. -
trunk/gli/src/org/greenstone/gatherer/cdm/DynamicListModel.java
r5590 r5785 91 91 } 92 92 93 publicDynamicListModel shallowCopy() {93 /* private DynamicListModel shallowCopy() { 94 94 DynamicListModel copy = new DynamicListModel(); 95 95 copy.setAutoOrder(auto_order); … … 98 98 } 99 99 return copy; 100 } 100 } */ 101 101 102 102 public Object getSelectedItem() { -
trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java
r5754 r5785 142 142 * @return A <strong>Language</strong> containing a two letter code. 143 143 */ 144 publicLanguage getDefaultLanguage() {144 /* private Language getDefaultLanguage() { 145 145 // If no default is set... 146 146 if(default_language != null && default_language.isAssigned()) { … … 148 148 } 149 149 return null; 150 } 150 } */ 151 151 152 152 /** Method to retrieve a certain language object by its code. -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java
r5590 r5785 99 99 * @return the default Index, or null if no such index assigned 100 100 */ 101 publicSubcollectionIndex getDefaultSubcollectionIndex() {101 /* private SubcollectionIndex getDefaultSubcollectionIndex() { 102 102 if(default_index != null && default_index.isAssigned()) { 103 103 return default_index; … … 106 106 return null; 107 107 } 108 } 108 } */ 109 109 110 110 /** Retrieve a certain subindex given its name. -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java
r5593 r5785 132 132 * @return an ArrayList of subcollections 133 133 */ 134 publicArrayList getSubcollections() {134 /* private ArrayList getSubcollections() { 135 135 return children(); 136 } 136 } */ 137 137 138 138 /** Method to remove the given subcollection. -
trunk/gli/src/org/greenstone/gatherer/collection/Collection.java
r5721 r5785 189 189 * @return The <strong>File</strong> this name maps to, or <i>null</i> if no such mapping. 190 190 */ 191 publicFile getDirectoryMapping(String name) {191 /* private File getDirectoryMapping(String name) { 192 192 File result = null; 193 193 try { … … 213 213 } 214 214 return result; 215 } 215 } */ 216 216 /** Retrieve the special directory mappings associated with this collection. 217 217 * @return A <strong>HashMap</strong> containing mappings from names to directories. … … 250 250 } 251 251 /** Counts the number of folders used in the current record set. */ 252 publicint getFolderCount() {252 /* private int getFolderCount() { 253 253 return getCount((TreeNode)Gatherer.c_man.getRecordSet().getRoot(), true, false); 254 } 254 } */ 255 255 /** Determine if this collection has had an import action run upon it since the last major change. 256 256 * @return <i>true</i> if an import has occured, <i>false</i> otherwise. 257 257 */ 258 publicboolean getImported() {258 /* private boolean getImported() { 259 259 return get(IMPORTED); 260 } 260 } */ 261 261 /** Retrieve the short name for this collection. 262 262 * @return The name as a <strong>String</strong>. -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r5761 r5785 462 462 * @see org.greenstone.gatherer.collection.Collection 463 463 */ 464 publicBuildOptions getBuildOptions() {464 /* private BuildOptions getBuildOptions() { 465 465 return collection.build_options; 466 } 466 } */ 467 467 468 468 /** Retrieve the current collection. … … 589 589 * @see org.greenstone.gatherer.collection.Collection 590 590 */ 591 publicString getCollectionTitle() {591 /* private String getCollectionTitle() { 592 592 if(collection != null) { 593 593 return collection.getTitle(); 594 594 } 595 595 return Dictionary.get("Collection.No_Collection"); 596 } 596 } */ 597 597 598 598 /** Retrieve the record set (tree model) associated with the current collection. */ … … 1110 1110 1111 1111 /** Updates the given workspace tree model to reference the private cache of the currently loaded collection. */ 1112 publicvoid updatePrivateWorkspace(DefaultTreeModel model) {1112 /* private void updatePrivateWorkspace(DefaultTreeModel model) { 1113 1113 // Add Private workspace if a collection has been loaded. 1114 1114 if(ready() && !Gatherer.config.get("workflow.mirror", true)) { … … 1121 1121 model.insertNodeInto(private_workspace, root, 2); 1122 1122 } 1123 } 1123 } */ 1124 1124 /** Called whenever the value tree of an metadata element changes in some way, such as the addition of a new value. We want to mark the collection so that it needs saving again. 1125 1125 * @param event A <strong>MSMEvent</strong> containing details of the event that caused this message to be fired. -
trunk/gli/src/org/greenstone/gatherer/collection/Job.java
r5593 r5785 478 478 * @return A String representing the currently downloading url. 479 479 */ 480 publicString getCurrent() {480 /* private String getCurrent() { 481 481 return current_url; 482 } 482 } */ 483 483 484 484 /** -
trunk/gli/src/org/greenstone/gatherer/file/FileNode.java
r5593 r5785 341 341 } 342 342 343 publicvoid setChildrenReadOnly(boolean children_readonly) {343 /* private void setChildrenReadOnly(boolean children_readonly) { 344 344 this.children_readonly = children_readonly; 345 } 345 } */ 346 346 347 347 public void setFile(File file) { -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r5751 r5785 626 626 * @param wait_allowed The new state of the wait_allowed flag, as a boolean. 627 627 */ 628 publicvoid setWaitAllowed(boolean wait_allowed) {628 /* private void setWaitAllowed(boolean wait_allowed) { 629 629 this.wait_allowed = wait_allowed; 630 } 630 } */ 631 631 /** Restore the progress bar so that it updates normally. 632 632 * @see org.greenstone.gatherer.gui.LongProgressBar 633 633 */ 634 synchronized publicvoid unpause() {634 /* synchronized private void unpause() { 635 635 progress.setIndeterminate(false); 636 636 if(previous != null) { … … 638 638 previous = null; 639 639 } 640 } 640 } */ 641 641 /** Called when the user makes some selection in one of the trees we are listening to. From this we update the status details. */ 642 642 public void valueChanged(TreeSelectionEvent event) { -
trunk/gli/src/org/greenstone/gatherer/file/FileSystemModel.java
r5593 r5785 196 196 } 197 197 198 publicvoid setPermanentFilter(String pattern) {198 /* private void setPermanentFilter(String pattern) { 199 199 if(pattern != null) { 200 200 FileFilter new_filter = new FileFilter(pattern, false); … … 206 206 } 207 207 filters = null; 208 } 208 } */ 209 209 210 210 public void setTree(DragTree tree) { -
trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java
r5593 r5785 317 317 * @return The build <strong>GShellProgressMonitor</strong>. 318 318 */ 319 publicGShellProgressMonitor getBuildProgress() {319 /* private GShellProgressMonitor getBuildProgress() { 320 320 return build_monitor; 321 } 321 } */ 322 322 323 323 /** Method to acquire the progress monitor associated with copying. 324 324 * @return The copying <strong>GShellProgressMonitor</strong>. 325 325 */ 326 publicGShellProgressMonitor getCopyProgress() {326 /* private GShellProgressMonitor getCopyProgress() { 327 327 return copy_monitor; 328 } 328 } */ 329 329 330 330 /** Method to acquire the progress monitor associated with import. 331 331 * @return The import <strong>GShellProgressMonitor</strong>. 332 332 */ 333 publicGShellProgressMonitor getImportProgress() {333 /* private GShellProgressMonitor getImportProgress() { 334 334 return import_monitor; 335 } 335 } */ 336 336 337 337 /** We are informed when this view pane loses focus so we can update build options. */ -
trunk/gli/src/org/greenstone/gatherer/gui/LongProgressBar.java
r5589 r5785 85 85 } 86 86 87 publicvoid refreshString() {87 /* private void refreshString() { 88 88 safeSetString(previous + "%"); 89 } 89 } */ 90 90 91 91 public void reset() { -
trunk/gli/src/org/greenstone/gatherer/gui/MenuBar.java
r5593 r5785 382 382 383 383 /** Set the enabled state of one of the help menu items, based on its 'tabs' current state. Note that this method should only be called from the AWTEvent thread. */ 384 publicvoid tabEnabled(int tab_index, boolean state) {384 /* private void tabEnabled(int tab_index, boolean state) { 385 385 JMenuItem selected = help.getItem(tab_index + 2); // Remember general and separator items 386 386 selected.setEnabled(state); 387 } 387 } */ 388 388 389 389 /** In order to provide context aware help advice we keep track of which -
trunk/gli/src/org/greenstone/gatherer/gui/SmarterTextArea.java
r5589 r5785 63 63 64 64 /** we want to be able to set the text without the user being able to */ 65 publicvoid systemSetText(String text) {65 /* private void systemSetText(String text) { 66 66 init = true; 67 67 setText(text); 68 68 init = false; 69 } 69 } */ 70 70 71 71 private class UnchangingDocument -
trunk/gli/src/org/greenstone/gatherer/msm/MSMAction.java
r5589 r5785 127 127 * @return A <strong>String</strong> stating the fully qualified name of the target element, within the namespace of one of the currently loaded metadata sets. 128 128 */ 129 publicString getTarget() {129 /* private String getTarget() { 130 130 return target; 131 } 132 publicboolean isHFile() {131 } */ 132 /* private boolean isHFile() { 133 133 return hfile; 134 } 134 } */ 135 135 } -
trunk/gli/src/org/greenstone/gatherer/msm/MSMEvent.java
r5589 r5785 149 149 return new_metadata; 150 150 } 151 publicGValueModel getNewModel() {151 /* private GValueModel getNewModel() { 152 152 return new_model; 153 } 153 } */ 154 154 /** Method to retrieve the old metadata associated with this event. 155 155 * @return A <strong>Metadata</strong>, or <i>null</i> if there is none. … … 158 158 return old_metadata; 159 159 } 160 publicGValueModel getOldModel() {160 /* private GValueModel getOldModel() { 161 161 return old_model; 162 } 162 } */ 163 163 /** Method to retrieve of the profile associated with this event. 164 164 * @return A <strong>MSMAction</strong> which details the action profile, or <i>null</i> if no profile exists. 165 165 */ 166 publicMSMAction getProfile() {166 /* private MSMAction getProfile() { 167 167 return profile; 168 } 168 } */ 169 169 /** Retrieve the record associated with this event. */ 170 170 public FileNode getRecord() { -
trunk/gli/src/org/greenstone/gatherer/msm/MSMPrompt.java
r5777 r5785 861 861 * @return The metadata set the user has selected or null if no set selected. 862 862 */ 863 final publicMetadataSet selectSet(String name) {863 /* final private MetadataSet selectSet(String name) { 864 864 String args[] = new String[1]; 865 865 args[0] = name; … … 941 941 dialog = null; 942 942 return null; 943 } 943 } */ 944 944 945 945 private class AddListener -
trunk/gli/src/org/greenstone/gatherer/msm/MSMUtils.java
r5747 r5785 147 147 * @return <i>true</i> if the path was found (including matching #text elements at the leaf), or <i>false</i> otherwise. 148 148 */ 149 static final publicboolean containsPath(Node tree, Node path[]) {149 /* static final private boolean containsPath(Node tree, Node path[]) { 150 150 // If there is no tree then there are no values. 151 151 if(tree == null) { … … 177 177 } 178 178 return false; 179 } 179 } */ 180 180 /** Method to compare two metadata elements (of type Element, which is bound to get more than a bit confusing) for equality. This test may only check the structural (ie pretty much unchanging) consistancy, or may include the AssignedValue tree as well (which will be different for each collection I'd imagine). 181 181 * @param a_set The <strong>MetadataSet</strong> a comes from. … … 390 390 * @return The pattern as a String. 391 391 */ 392 static final publicString getFileNamePattern(Node fileset) {392 /* static final private String getFileNamePattern(Node fileset) { 393 393 // Locate the child node called filename 394 394 for(Node child = fileset.getFirstChild(); child != null; child = child.getNextSibling()) { … … 399 399 } 400 400 return null; 401 } 401 } */ 402 402 403 403 /*************************************************************************/ … … 406 406 * @return A fully qualified identifier as a <strong>String</strong> 407 407 */ 408 static final publicString getFullIdentifier(Node element, String namespace) {408 /* static final private String getFullIdentifier(Node element, String namespace) { 409 409 StringBuffer identifier_buffer = new StringBuffer(); 410 410 if(element == null) { … … 438 438 namespace = null; 439 439 return identifier_buffer.toString(); 440 } // static public String getFullIdentier(Node element) 440 } */ 441 441 442 442 /*************************************************************************/ … … 530 530 * @return The description node or null if no such node. 531 531 */ 532 static final publicNode getMetadataDescription(Node fileset) {532 /* static final private Node getMetadataDescription(Node fileset) { 533 533 // Locate the child node called filename 534 534 for(Node child = fileset.getLastChild(); child != null; child = child.getPreviousSibling()) { … … 538 538 } 539 539 return null; 540 } 540 } */ 541 541 542 542 /** Method to retrieve from the node given, a certain child node with the specified name. -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSet.java
r5777 r5785 301 301 * @return A <strong>String</strong> containing the address. 302 302 */ 303 publicString getContact() {303 /* private String getContact() { 304 304 return root.getAttribute("contact"); 305 } 305 } */ 306 306 /** Method to retrieve the name of the creator of this metadata set. 307 307 * @return A <strong>String</strong> containing the name. -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java
r5748 r5785 466 466 * @return A NodeList[] of metadata elements. 467 467 */ 468 publicNodeList[] getNodeLists() {468 /* private NodeList[] getNodeLists() { 469 469 NodeList elements[] = null; 470 470 int index = 0; … … 478 478 } 479 479 return elements; 480 } 480 } */ 481 481 482 482 /** Retrieve the named metadata set. … … 930 930 * @param new_name The String to use as the new name. 931 931 */ 932 publicvoid renameElement(ElementWrapper element, String new_name) {932 /* private void renameElement(ElementWrapper element, String new_name) { 933 933 Element e = element.getElement(); 934 934 String old_name = element.toString(); … … 937 937 old_name = null; 938 938 e = null; 939 } 939 } */ 940 940 /** A method to save the state of this metadata set manager. First we ensure that the names of all included metadata sets have been added to the collection configuration file, then all of the metadata sets contained are exported with full content to the collect/<col_name>/metadata/ directory. 941 941 */ -
trunk/gli/src/org/greenstone/gatherer/shell/GShell.java
r5593 r5785 115 115 * @param listener The <i>GShellListener</i> to be removed. 116 116 */ 117 publicvoid removeGShellListener(GShellListener listener) {117 /* private void removeGShellListener(GShellListener listener) { 118 118 listeners.remove(GShellListener.class, listener); 119 } 119 } */ 120 120 /** Any threaded class must include this method to allow the thread body to be run. */ 121 121 public void run() { -
trunk/gli/src/org/greenstone/gatherer/undo/UndoManager.java
r5589 r5785 260 260 } 261 261 262 publicvoid fileDeleted(long id, DragComponent source_model, FileNode source_parent, FileNode target_parent, FileNode record, boolean undo_event) {262 /* private void fileDeleted(long id, DragComponent source_model, FileNode source_parent, FileNode target_parent, FileNode record, boolean undo_event) { 263 263 UndoJob job = new UndoJob(id, source_model, source_parent, this, record, FILE_DELETE); 264 264 if(undo_event) { … … 270 270 redo.push(job); 271 271 } 272 } 272 } */ 273 273 274 274 public void fileMoved(long id, DragComponent source_model, FileNode source_parent, DragComponent target_model, FileNode target_parent, FileNode record, boolean undo_event) { … … 339 339 } 340 340 341 static final publicFile generateUniqueFile(FileNode record) {341 /* static final private File generateUniqueFile(FileNode record) { 342 342 String filename_raw = ArrayTools.objectArrayToString(record.getPath()); 343 343 int hash_code = filename_raw.hashCode(); … … 349 349 } 350 350 return file; 351 } 351 } */ 352 352 353 353 private void showTree() { -
trunk/gli/src/org/greenstone/gatherer/util/ArrayTools.java
r5581 r5785 181 181 * @return The same <strong>FileNode[]</strong> sans its head element. 182 182 */ 183 static final publicFileNode[] tail(FileNode a[]) {183 /* static final private FileNode[] tail(FileNode a[]) { 184 184 if(a.length == 1) { 185 185 return null; … … 188 188 System.arraycopy(a, 1, b, 0, b.length); 189 189 return b; 190 } 190 } */ 191 191 192 192 /** Append a Metadata object onto an array of Metadata objects. */ -
trunk/gli/src/org/greenstone/gatherer/util/GURL.java
r5581 r5785 124 124 } 125 125 126 publicString getLocalFile() {126 /* private String getLocalFile() { 127 127 String local_file = getPath() + File.separator + getFile(); 128 128 // Strip msdos roots if they're still there. … … 131 131 } 132 132 return local_file; 133 } 133 } */ 134 134 135 135 public String getPath() { -
trunk/gli/src/org/greenstone/gatherer/util/HTMLStringTokenizer.java
r5581 r5785 96 96 * @return A <strong>String</strong> representing the token. 97 97 */ 98 publicString sameToken() {98 /* private String sameToken() { 99 99 return previous; 100 } 100 } */ 101 101 /** Parses the next token and stores it in current. 102 102 */ -
trunk/gli/src/org/greenstone/gatherer/util/HashMap3D.java
r5581 r5785 124 124 * @return The first unique instance of the target <strong>Metadata</strong> which may in fact be the same metadata given as a paramater. 125 125 */ 126 publicMetadata locate(Metadata metadata) {126 /* private Metadata locate(Metadata metadata) { 127 127 Metadata result = null; 128 128 if(metadata != null) { … … 146 146 } 147 147 return result; 148 } 148 } */ 149 149 /** Put an entry into this three dimensional hash mapping. 150 150 * @param key_one The first key, to store this value under, as an <strong>Object</strong>. -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r5771 r5785 160 160 /** The image for a toggle button whose state is 'off'. */ 161 161 static final public ImageIcon OFF_ICON = new ImageIcon(ClassLoader.getSystemResource("images/cross.gif")); 162 /** Method to turn a file from with the system file tree into a tree path for insertion into a tree.163 * @param file The <strong>File</strong> whose tree path you are attempting to discover.164 * @param in_col A <i>boolean</i> indicating whether we are looking for a file within a collection of not. If <i>true</i> then the tree paths head in the collection name, and no element in the path refers to the import directory. Otherwise the paths head will be one of the system roots and all traversed file locations will exist in the path.165 * @return A <strong>TreePath</strong> which traverses the file system tree to the specified file.166 */167 public static TreePath createTreePath(File file, boolean in_col) {168 TreePath path = null;169 // Get the absolute path of the file.170 String abs_path = file.getAbsolutePath();171 while(file != null) {172 // If we are looking for a node within our collection, we expect173 // its path from root to be <col_name>/... without any higher174 // details and without gimport. So if we encounter a gimport we175 // skip to its parent, add that, then return.176 if(in_col && file.getName().equals("gimport")) {177 file = file.getParentFile();178 if(path == null) {179 path = new TreePath(file.getName());180 }181 else {182 path = path.pathByAddingChild(file.getName());183 }184 file = null;185 }186 else {187 if(path == null) {188 path = new TreePath(file.getName());189 }190 else {191 path = path.pathByAddingChild(file.getName());192 }193 file = file.getParentFile();194 }195 }196 // Unfortunately we've created the path in reverse order so we have to197 // reverse it.198 Object temp[] = new Object[path.getPathCount()];199 for(int i = 0; i < temp.length; i++) {200 temp[(temp.length - 1) - i] = path.getPathComponent(i);201 }202 return new TreePath(temp);203 }204 162 205 163 /** Decodes a string of text so its safe to use in a Greenstone configuration file. Esentially replaces "\n" with a newline. … … 221 179 * @return The decoded <strong>String</strong>. 222 180 */ 223 publicstatic String decodeString(String encoded) {181 /* private static String decodeString(String encoded) { 224 182 String decoded = ""; 225 183 for(int i = 0; i < encoded.length(); i++) { … … 239 197 } 240 198 return decoded; 241 } 199 } */ 242 200 /** It turns out that in Java you have to make sure a directory is empty before you delete it (much like unix I suppose), and so just like unix I'll have to set up a recursive delete function. 243 201 * @param file The <strong>File</strong> you want to delete. … … 260 218 } 261 219 262 static publicString encodeGreenstone(String raw) {220 /* static private String encodeGreenstone(String raw) { 263 221 raw = raw.replaceAll("<", "<"); 264 222 raw = raw.replaceAll(">", ">"); 265 223 raw = raw.replaceAll("\n", "\\\\n"); 266 224 return raw; 267 } 225 } */ 268 226 269 227 /** Using this method we can request that a certain document be written, as valid XML, to a certain output stream. This makes use of the Xerces Serialization suite, which should in no way be confused with the usual method of Serialization used by Java. */ … … 578 536 * @return A <strong>String</strong> representation of the mirroring depth padded to length characters. 579 537 */ 580 publicstatic String getDepthString(int length) {538 /* private static String getDepthString(int length) { 581 539 return pad("" + Gatherer.self.config.getInt("mirroring.depth", false), length); 582 } 540 } */ 583 541 /** Method which constructs the etc directory given a certain collection. 584 542 * @param col_dir The location of the collection directory as a <strong>String</strong>. … … 646 604 647 605 648 static publicFile getRecycleDirectory() {606 /* static private File getRecycleDirectory() { 649 607 return new File(RECYCLE); 650 } 608 } */ 651 609 652 610 /** Determine whether a character is a hexidecimal one. … … 900 858 * @return A filtered <strong>File[]</strong> containing only those drives that are accessible and/or are floppy-disk media drives. 901 859 */ 902 publicstatic File[] validateDrives(File roots[]) {860 /* private static File[] validateDrives(File roots[]) { 903 861 Vector valid = new Vector(); 904 862 for(int i = 0; i < roots.length; i++) { … … 914 872 } 915 873 return roots; 916 } 874 } */ 917 875 } -
trunk/gli/src/org/greenstone/gatherer/valuetree/GValueModel.java
r5671 r5785 253 253 * this value in. 254 254 */ 255 publicGValueNode updateValue(String new_value, String old_value, GValueNode subject) {255 /* private GValueNode updateValue(String new_value, String old_value, GValueNode subject) { 256 256 return addValue(new_value, subject, null); 257 } 257 } */ 258 258 259 259 private GValueModel copy() { -
trunk/gli/src/org/greenstone/gatherer/valuetree/GValueNode.java
r5672 r5785 92 92 * @return <i>true</i> if there is a matching child node, <i>false</i> otherwise. 93 93 */ 94 publicboolean containsValue(String value) {94 /* private boolean containsValue(String value) { 95 95 if(default_value != null) { 96 96 return false; 97 97 } 98 98 return getValue(value) != null; 99 } 99 } */ 100 100 101 101 /** Returns an enumeration of the child nodes.
Note:
See TracChangeset
for help on using the changeset viewer.