diff --git a/ModelCrawler/LICENSE b/ModelCrawler/LICENSE new file mode 100644 index 0000000..9d18abc --- /dev/null +++ b/ModelCrawler/LICENSE @@ -0,0 +1,36 @@ +The Clear BSD License + +Copyright (c) 2007-2015 Martin Scharm -- + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted (subject to the limitations in the +disclaimer below) provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + + * Neither the name of nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE +GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT +HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/ModelCrawler/pom.xml b/ModelCrawler/pom.xml old mode 100755 new mode 100644 index 34b8876..4e41688 --- a/ModelCrawler/pom.xml +++ b/ModelCrawler/pom.xml @@ -1,18 +1,25 @@ 4.0.0 - de.unirostock.sems + de.uni-rostock.sbi ModelCrawler - 0.1.1 + 0.2.7 jar - + Command line tool to crawl all model versions from database like BioModels Database and PMR2 ModelCrawler - http://sems.uni-rostock.de + https://semsproject.github.io/ModelCrawler/ + + + The Clear BSD License + http://directory.fsf.org/wiki/License:ClearBSD + repo + + - GIT - ssh://sems.uni-rostock.de/modelcrawler - Martin Peters + https://github.com/binfalse/ModelCrawler.git + https://github.com/binfalse/ModelCrawler + scm:git:ssh://github.com:binfalse/ModelCrawler.git SEMS (Simulation Experiment Management for Systems Biology) @@ -33,6 +40,9 @@ martin Martin Scharm martin@binfalse.de + + Java Developer + @@ -45,7 +55,7 @@ junit junit - 3.8.1 + 4.13.1 test @@ -58,12 +68,12 @@ org.apache.commons commons-compress - 1.9 + 1.21 commons-io commons-io - 2.4 + 2.7 @@ -75,12 +85,12 @@ org.apache.logging.log4j log4j-api - 2.2 + 2.16.0 org.apache.logging.log4j log4j-core - 2.2 + 2.16.0 org.apache.logging.log4j @@ -109,38 +119,38 @@ - de.unirostock.sems + de.uni-rostock.sbi BiVeS - 1.3.11.1 + 1.11.3 de.binfalse BFUtils - 0.4 + 0.5.4 - de.unirostock.sems + de.uni-rostock.sbi morre.client - 0.0.9-SNAPSHOT + 0.0.9 com.fasterxml.jackson.core jackson-core - 2.5.1 + [2.9.9,) com.fasterxml.jackson.core jackson-annotations - 2.5.1 + [2.9.9,) com.fasterxml.jackson.core jackson-databind - 2.5.1 + [2.9.9,) @@ -149,28 +159,23 @@ json-collection 3.1.0 + + javax.xml.bind + jaxb-api + 2.3.1 + - - - - sems-maven-repository-releases - SEMS Maven Repo - http://mvn.sems.uni-rostock.de/releases/ - default - - false - - + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + - sems-maven-repository-snapshots - SEMS Maven Repo - http://mvn.sems.uni-rostock.de/snapshots/ - default - - false - + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ - + @@ -207,16 +212,70 @@ + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + true + false + release + deploy + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.1 + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + - - - - - org.apache.maven.wagon - wagon-ssh - 1.0-beta-7 - - ${project.build.outputDirectory}/res @@ -228,50 +287,4 @@ - - - - - - release - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - true - - - - attach-sources - - jar - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - - - - - \ No newline at end of file + diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/App.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/App.java index 3c8cb0e..7fa5da7 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/App.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/App.java @@ -35,7 +35,12 @@ public class App { private static Map changes = null; private static Map changesPerRelease = null; - + + public static void main(String [] args) { + getApp(args); + } + + // avoid creating more than one crawler public static App getApp(String[] args) { if( instance == null ){ @@ -44,8 +49,6 @@ public static App getApp(String[] args) { return instance; } - - //public static void main( String[] args ) { /* create a crawler from the provided configuration * and crawls the provided datasets diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/Config.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/Config.java index 2e0ef90..f82bd31 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/Config.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/Config.java @@ -39,7 +39,7 @@ public static enum WorkingMode { /** * Gets the config instance * - * @return + * @return the config */ public static Config getConfig() { @@ -52,7 +52,7 @@ public static Config getConfig() { /** * returns the default jackson object mapper for serializing and deserializing json objects * - * @return + * @return a default jackson object mapper */ public static ObjectMapper getObjectMapper() { @@ -68,9 +68,11 @@ public static ObjectMapper getObjectMapper() { } /** - * Loads the config from a Json file - * @return - * @throws ConfigurationException + * Loads the config from a Json file. + * + * @param location the location + * @return the config as stored in `location` + * @throws ConfigurationException the configuration exception */ public synchronized static Config load( File location ) throws ConfigurationException { @@ -89,9 +91,9 @@ public synchronized static Config load( File location ) throws ConfigurationExce } /** - * Loads some default config parameters - * - * @return + * Loads some default config parameters. + * + * @return a default config */ public synchronized static Config defaultConfig() { @@ -104,7 +106,7 @@ public synchronized static Config defaultConfig() { /** * Gets the current working mode of the crawler - * @return + * @return the current working mode */ public static WorkingMode getWorkingMode() { return Config.workingMode; @@ -113,7 +115,7 @@ public static WorkingMode getWorkingMode() { /** * Sets the current working mode of the crawler * - * @param workingMode + * @param workingMode the working mode */ public static void setWorkingMode(WorkingMode workingMode) { Config.workingMode = workingMode; @@ -138,17 +140,17 @@ public static void setWorkingMode(WorkingMode workingMode) { /** * Default private constructor. * - * use {@link getConfig} or {@link load} instead + * use {@link #getConfig()} or {@link #load(File)} instead */ private Config() { } /** - * Saves the current config to disk - * - * @param location - * @throws ConfigurationException + * Saves the current config to disk. + * + * @param location the location to write to + * @throws ConfigurationException the configuration exception */ public synchronized void save( File location ) throws ConfigurationException { diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/CrawlerAPI.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/CrawlerAPI.java index 43c403d..17d7820 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/CrawlerAPI.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/CrawlerAPI.java @@ -89,10 +89,11 @@ private static void printChangesPerRelease(Map changesPerRele /** - * Return a specific field of the given change - * @param change - * @param field - * @return + * Return a specific field of the given change. + * + * @param change the change + * @param field the field + * @return the change */ private static String getChange(Change change, String field) { String result = null; @@ -114,10 +115,11 @@ private static String getChange(Change change, String field) { /** - * Return all ChangeSet changes associated with the given modelName - * @param changesPerRelease - * @param modelName - * @return + * Return all ChangeSet changes associated with the given modelName. + * + * @param changesPerRelease the changes per release + * @param modelName the model name + * @return the model change set */ public static ChangeSet getModelChangeSet(Map changesPerRelease, String modelName) { return changesPerRelease.get(modelName); @@ -125,10 +127,11 @@ public static ChangeSet getModelChangeSet(Map changesPerRelea /** - * Return a specific field within the provided model's change - * @param change - * @param field - * @return + * Return a specific field within the provided model's change. + * + * @param change the change + * @param field the field + * @return the model change */ public static String getModelChange(Change change, String field) { return getChange(change, field); @@ -138,7 +141,8 @@ public static String getModelChange(Change change, String field) { /** * Class demo. Uncomment the procedure you wish to test - * @param args + * + * @param args the args */ public static void main(String[] args){ CrawlerAPI crawlerAPI = new CrawlerAPI(args); diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsChange.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsChange.java index e2ba876..12d09ea 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsChange.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsChange.java @@ -33,7 +33,8 @@ public class BioModelsChange extends Change { // super( repositoryUrl, fileName, versionId, versionDate, crawledDate ); //} public BioModelsChange( URL repositoryUrl, String filePath, String versionId, Date versionDate, Date crawledDate ) throws URISyntaxException { - super( repositoryUrl, filePath, versionId, versionDate, crawledDate ); + super( repositoryUrl, new String(FilenameUtils.getBaseName(filePath) + "." + FilenameUtils.getExtension(filePath)), versionId, versionDate, crawledDate ); + //super( repositoryUrl, filePath, versionId, versionDate, crawledDate ); } // old: diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsDb.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsDb.java index c28df13..8419222 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsDb.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/BioModelsDb/BioModelsDb.java @@ -123,7 +123,8 @@ public void close() { // deletes the tempDir recursively try { - FileUtils.deleteDirectory(tempDir); + if (tempDir != null && tempDir.exists ()) + FileUtils.deleteDirectory(tempDir); } catch (IOException e) { log.error("Error while cleaning up the temp dir!", e); } @@ -223,9 +224,9 @@ else if( log.isInfoEnabled() ) { /** * Downloads, extracts and indexes the gives release - * must called for each new release CHRONOLOGICAL - * - * @param release + * must called for each new release CHRONOLOGICAL. + * + * @param release the release */ //protected Map processRelease( BioModelRelease release ) { protected void processRelease( BioModelRelease release ) { @@ -848,7 +849,7 @@ else if( Config.getWorkingMode() == WorkingMode.NO_MORRE ) { ChangeSet elementChangeSet = changeSetMap.get(element); if (elementChangeSet.getChanges().size() == 0) { log.debug("Empty :("); - System.exit(1); +// System.exit(1); } Iterator changeIterator = elementChangeSet.getChanges().iterator(); while(changeIterator.hasNext()) { diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/Interface/Change.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/Interface/Change.java index 6beea05..ae4a295 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/Interface/Change.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/Interface/Change.java @@ -30,7 +30,8 @@ public abstract class Change extends CrawledModelRecord implements Comparable * the fileId is the map key. * - * @return Map + * @return the list of changes */ @JsonIgnore public abstract Map listChanges(); - /** - * Returns the ChangeSet only for one specific model - * - * @param fileId + /** + * Returns the ChangeSet only for one specific model. + * + * @param fileId the file id * @return ChangeSet */ @JsonIgnore @@ -123,9 +123,9 @@ protected synchronized File createTempDir() { public abstract void close(); /** - * Starts the prozess of crawling for this specific Database - * @return - * + * Starts the process of crawling for this specific Database. + * + * @return the map of files and changes */ @JsonIgnore public abstract Map call(); diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/PmrDb.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/PmrDb.java index 4c2d589..d48d400 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/PmrDb.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/PmrDb.java @@ -280,8 +280,9 @@ protected void init() { } /** - * Returns a non existent temporary file - * @return + * Returns a non existent temporary file. + * + * @return the temp file */ protected File getTempFile() { File temp = new File( tempDir, UUID.randomUUID().toString() ); @@ -314,10 +315,10 @@ protected void saveProperties() { /** - * Retrieves the txt Repository List and puts it in a list - * - * @return - * @throws HttpException + * Retrieves the txt Repository List and puts it in a list. + * + * @return the repository list + * @throws HttpException the http exception */ protected LinkedHashSet getRepositoryList() throws HttpException { LinkedHashSet repoList = new LinkedHashSet(); @@ -431,10 +432,10 @@ protected URL transformExposureUrl(URL link) { } /** - * Creates the directory for the given Repository - * - * @param repository - * @return + * Creates the directory for the given Repository. + * + * @param repository the repository + * @return the file object representing the new repository directory */ protected File makeRepositoryDirectory( String repository ) { @@ -481,10 +482,10 @@ protected File makeRepositoryDirectory( String repository ) { } /** - * Gets the Path to the Repository Directory out of Workspace config or null if it fails - * - * @param repository - * @return File + * Gets the Path to the Repository Directory out of Workspace config or null if it fails. + * + * @param repository the repository + * @return the repo file */ protected File getRepositoryDirectory( String repository ) { String repoHash = calculateRepositoryHash(repository); @@ -497,10 +498,10 @@ protected File getRepositoryDirectory( String repository ) { } /** - * Calculates the hash from the Repository URL - * - * @param repository - * @return + * Calculates the hash from the Repository URL. + * + * @param repository the repository + * @return the repo hash */ private String calculateRepositoryHash( String repository ) { String repoHash = null; @@ -607,7 +608,7 @@ protected void scanAndTransferRepository( String repoUrl, File location, Git rep if( log.isInfoEnabled() ) log.info( MessageFormat.format("Start scanning {0} for changes", repoUrl) ); - + // select all relevant files relevantFiles = scanRepository(location); @@ -627,7 +628,7 @@ protected void scanAndTransferRepository( String repoUrl, File location, Git rep catch (MalformedURLException | URISyntaxException e) { log.fatal("Unsupported Encoding. Can not generate fileId", e); } - + // detect all relevant versions relevantVersions = detectRelevantVersions(repo, relevantFiles); @@ -742,11 +743,11 @@ else if( entry.isFile() && entry.exists() ) { /** * Checks if the file is a model aka relevant
- * Returns a RelevantFile object if it is or null - * - * @param base - * @param model - * @return + * Returns a RelevantFile object if it is or null. + * + * @param base the base + * @param model the model + * @return true if file is relevant, otherwise false */ private RelevantFile isRelevant( File base, File model ) { int type = 0; @@ -985,7 +986,7 @@ protected void iterateRelevantVersions( Git repo, File location, List skip @@ -1001,7 +1002,6 @@ protected void iterateRelevantVersions( Git repo, File location, List no changes."); - continue; } else diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/RelevantFile.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/RelevantFile.java index 56091b9..3d5b1b0 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/RelevantFile.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/databases/PMR2/RelevantFile.java @@ -7,49 +7,98 @@ import de.unirostock.sems.ModelCrawler.databases.Interface.Change; +/** + * The Class RelevantFile. + */ public class RelevantFile { + /** The file path. */ private String filePath; + + /** The repo url. */ private URL repoUrl = null; + + /** The file id. */ private String fileId; + + /** The latest known version id. */ private String latestKnownVersionId = null; + + /** The latest known version date. */ private Date latestKnownVersionDate = null; + + /** The type. */ private int type = 0; + /** The change set. */ private PmrChangeSet changeSet = null; + /** + * The Constructor. + * + * @param filePath the file path + * @param fileId the file id + */ public RelevantFile( String filePath, String fileId ) { this.filePath = filePath; this.fileId = fileId; } + /** + * The Constructor. + * + * @param filePath the file path + */ public RelevantFile( String filePath ) { this.filePath = filePath; } + /** + * Generate file id. + * + * @param repoUrl the repo url + * @return the string + * @throws MalformedURLException the malformed url exception + * @throws URISyntaxException the URI syntax exception + */ public String generateFileId( String repoUrl ) throws MalformedURLException, URISyntaxException { this.repoUrl = new URL(repoUrl); return this.fileId = Change.generateFileId(this.repoUrl , filePath); } + /** + * Gets the file path. + * + * @return the file path + */ public String getFilePath() { return filePath; } + /** + * Gets the repository url. + * + * @return the repository url + */ public URL getRepositoryUrl() { return repoUrl; } + /** + * Gets the file id. + * + * @return the file id + */ public String getFileId() { return fileId; } /** - * Sets the latest known Version of this model and the changeSet of it - * - * @param latestVersionId - * @param latestVersionDate - * @param changeSet + * Sets the latest known Version of this model and the changeSet of it. + * + * @param latestVersionId the latest version id + * @param latestVersionDate the latest version date + * @param changeSet the change set */ public void setLatestKnownVersion( String latestVersionId, Date latestVersionDate, PmrChangeSet changeSet ) { this.latestKnownVersionId = latestVersionId; @@ -58,10 +107,10 @@ public void setLatestKnownVersion( String latestVersionId, Date latestVersionDat } /** - * Sets the latest known Version of this model - * - * @param latestVersionId - * @param latestVersionDate + * Sets the latest known Version of this model. + * + * @param latestVersionId the latest version id + * @param latestVersionDate the latest version date */ public void setLatestKnownVersion( String latestVersionId, Date latestVersionDate ) { setLatestKnownVersion( latestVersionId, latestVersionDate, null ); @@ -134,8 +183,8 @@ public Date getLatestVersionDate() { } /** - * Return the changeSet or null, if no one was setted and no change added - * + * Return the changeSet or null, if no one was setted and no change added. + * * @return PmrChangeSet or null */ public PmrChangeSet getChangeSet() { @@ -144,8 +193,8 @@ public PmrChangeSet getChangeSet() { /** * Adds a change to the changeSet and creates one if necessary. - * - * @param change + * + * @param change the change */ public void addChange( PmrChange change ) { @@ -162,10 +211,20 @@ public void addChange( PmrChange change ) { changeSet.addChange(change); } + /** + * Gets the type. + * + * @return the type + */ public int getType() { return type; } + /** + * Sets the type. + * + * @param type the type + */ public void setType(int type) { this.type = type; } diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/CrawledModelRecord.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/CrawledModelRecord.java index 4198c7f..3d05072 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/CrawledModelRecord.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/CrawledModelRecord.java @@ -23,9 +23,9 @@ public static CrawledModelRecord extendDataholder( CrawledModel model ) { } /** - * Creates a new CrawledModelRecord based on a simple CrawledModel Dataholder - * - * @param model + * Creates a new CrawledModelRecord based on a simple CrawledModel Dataholder. + * + * @param model the model */ public CrawledModelRecord( CrawledModel model ) { super( model.getFileId(), model.getVersionId(), model.getXmldoc(), model.getParentMap(), model.getMetaMap(), model.getModelType() ); @@ -49,8 +49,8 @@ public CrawledModelRecord(String fileId, String versionId, Date versionDate, Dat /** * Checks if the model dataholder is valid. - * - * @return + * + * @return true, if is available */ public boolean isAvailable() { @@ -67,10 +67,10 @@ public boolean isAvailable() { } /** - * Returns the value of a meta field or null - * - * @param metaField - * @return + * Returns the value of a meta field or null. + * + * @param metaField the meta field + * @return the meta */ public String getMeta( String metaField ) { Map metaMap = getMetaMap(); @@ -81,10 +81,10 @@ public String getMeta( String metaField ) { } /** - * Sets the value of a meta field and overrides the previous value - * - * @param metaField - * @param value + * Sets the value of a meta field and overrides the previous value. + * + * @param metaField the meta field + * @param value the value */ public void setMeta( String metaField, String value ) { Map metaMap = getMetaMap(); @@ -96,9 +96,9 @@ public void setMeta( String metaField, String value ) { } /** - * Returns the parsed VersionDate if it is set, or null - * - * @return + * Returns the parsed VersionDate if it is set, or null. + * + * @return the version date */ public Date getVersionDate() { Date versionDate = null; @@ -117,18 +117,18 @@ public Date getVersionDate() { } /** - * Sets the VersionDate in the Meta Field - * - * @param versionDate + * Sets the VersionDate in the Meta Field. + * + * @param versionDate the version date */ public void setVersionDate( Date versionDate ) { setMeta(META_VERSION_DATE, new SimpleDateFormat(DATE_FORMAT).format(versionDate) ); } /** - * Returns the parsed CrawledDate if it is set, or null - * - * @return + * Returns the parsed CrawledDate if it is set, or null. + * + * @return the crawled date */ public Date getCrawledDate() { Date crawledDate = null; @@ -147,9 +147,9 @@ public Date getCrawledDate() { } /** - * Sets the CrawledDate in the Meta Field - * - * @param versionDate + * Sets the CrawledDate in the Meta Field. + * + * @param crawledDate the crawled date */ public void setCrawledDate( Date crawledDate ) { setMeta(META_CRAWLED_DATE, new SimpleDateFormat(DATE_FORMAT).format(crawledDate) ); @@ -157,9 +157,9 @@ public void setCrawledDate( Date crawledDate ) { /** * Adds a parent to this model. - * - * @param parentFileId - * @param parentVersionId + * + * @param parentFileId the parent file id + * @param parentVersionId the parent version id */ public void addParent( String parentFileId, String parentVersionId ) { @@ -187,9 +187,9 @@ public void addParent( String parentFileId, String parentVersionId ) { } /** - * Adds a parent to this model with the same fileId - * - * @param parentVersionId + * Adds a parent to this model with the same fileId. + * + * @param parentVersionId the parent version id */ public void addParent( String parentVersionId ) { addParent( getFileId(), parentVersionId ); diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/RelativPath.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/RelativPath.java index d9cd744..1b103e9 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/RelativPath.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/helper/RelativPath.java @@ -8,7 +8,7 @@ public class RelativPath { /** * Returns the path of one File relative to another.
- * copy'n'paste from {@link http://stackoverflow.com/a/1269907} + * copy'n'paste from @see stackoverflow.com/a/1269907 * * @param target the target directory * @param base the base directory diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/FileBasedStorage.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/FileBasedStorage.java index 23e3997..dead080 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/FileBasedStorage.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/FileBasedStorage.java @@ -220,13 +220,15 @@ public URI linkModelVersion(String fileId, String sourceVersionId, String target } /** - * Splits the fileId into handy parts
- * 0 - outerPath
- * 1 - innerPath
- * 2 - fileName
- * - * @param fileId - * @return + * Splits the fileId into handy parts + *
    + *
  • 0 - outerPath
  • + *
  • 1 - innerPath
  • + *
  • 2 - fileName
  • + *
+ * + * @param fileId the file id + * @return the plitted field */ private String[] splitFileId( String fileId ) { final int OUTER_PATH = 0; diff --git a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/ModelStorage.java b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/ModelStorage.java index d893208..1dfdec8 100644 --- a/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/ModelStorage.java +++ b/ModelCrawler/src/main/java/de/unirostock/sems/ModelCrawler/storage/ModelStorage.java @@ -41,10 +41,9 @@ public ModelStorage() { /** * Connects to the storage destination, is supposed to be called - * before every other operation - * - * @throws StorageException - * + * before every other operation. + * + * @throws StorageException the storage exception */ public abstract void connect() throws StorageException; @@ -55,32 +54,32 @@ public ModelStorage() { public abstract void close(); /** - * Puts a model into the storage system and returns the URI - * - * @param modelChange - * @return - * @throws StorageException + * Puts a model into the storage system and returns the URI. + * + * @param modelChange the model change + * @return the uri to the model + * @throws StorageException the storage exception */ public abstract URI storeModel( Change modelChange ) throws StorageException; /** - * Links the source Version to the target Version - * (The target Version should exist already) - * - * @param fileId - * @param sourceVersionId - * @param targetVersionId - * @return - * @throws StorageException + * Links the source Version to the target Version + * (The target Version should exist already). + * + * @param fileId the file id + * @param sourceVersionId the source version id + * @param targetVersionId the target version id + * @return the uri + * @throws StorageException the storage exception */ public abstract URI linkModelVersion( String fileId, String sourceVersionId, String targetVersionId) throws StorageException; /** - * Puts a whole ChangeSet of models into the storage system - * - * @param changeSet - * @return - * @throws StorageException + * Puts a whole ChangeSet of models into the storage system. + * + * @param changeSet the change set + * @return the list of stored changes + * @throws StorageException the storage exception */ public List storeModelChangeSet( ChangeSet changeSet ) throws StorageException { List result = new LinkedList();