Changeset 25551 for main/trunk


Ignore:
Timestamp:
2012-05-09T13:53:19+12:00 (12 years ago)
Author:
sjm84
Message:

Removed some redundant code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSDocumentModel.java

    r25542 r25551  
    130130            return;
    131131        }
    132        
     132
    133133        //If the collection is not specified then we cannot continue
    134134        if (oid == null || oid.equals(""))
     
    153153        if (!section)
    154154        {
    155             File newDir = new File(_siteHome + File.separatorChar + "collect" + File.separatorChar + collection + File.separatorChar + "archives" + File.separatorChar + oid);
    156 
    157             if (!newDir.exists())
    158             {
    159                 newDir.mkdir();
    160             }
    161 
    162             HashMap<String, ArrayList<String>> entries = new HashMap<String, ArrayList<String>>();
    163             ArrayList<String> values = new ArrayList<String>();
    164             values.add(oid + "/doc.xml");
    165             entries.put("doc-file", values);
    166 
    167             //Write the new entry to the archive database
    168             archiveWriteEntryToDatabase(oid, collection, entries, userContext);
    169             if (_errorStatus != NO_ERROR)
    170             {
    171                 return;
    172             }
    173 
    174155            //Create a basic doc.xml file to go in the new folder
    175156            documentXMLCreateDocXML(oid, collection, userContext);
     
    398379                return;
    399380            }
    400            
     381
    401382            if (move)
    402383            {
     
    676657        {
    677658            String s = File.separator;
    678            
     659
    679660            String docFolderPath = _siteHome + s + "collect" + s + collection + s + "import" + s + oid;
    680661            File docFolder = new File(docFolderPath);
    681            
     662
    682663            if (!docFolder.exists())
    683664            {
    684                 if(!docFolder.mkdirs())
     665                if (!docFolder.mkdirs())
    685666                {
    686667                    _errorStatus = ERROR_DOC_XML_COULD_NOT_BE_CREATED;
     
    688669                }
    689670            }
    690            
     671
    691672            File docFile = new File(docFolderPath + s + "doc.xml");
    692             if(!docFile.exists() && !docFile.createNewFile())
     673            if (!docFile.exists() && !docFile.createNewFile())
    693674            {
    694675                _errorStatus = ERROR_DOC_XML_COULD_NOT_BE_CREATED;
     
    12621243            }
    12631244        }
    1264        
     1245
    12651246        //Write the new change back into the file
    12661247        if (!writeXMLFile(docXML, oid, collection, userContext))
     
    16231604            return;
    16241605        }
     1606
    16251607        coll_db.setInfo(oid, info);
    16261608        coll_db.closeDatabase();
     
    20792061        }
    20802062    }
    2081    
     2063
    20822064    public int getErrorStatus()
    20832065    {
Note: See TracChangeset for help on using the changeset viewer.