CPD Results

The following document contains the results of PMD's CPD 3.7.

Duplications

FileLine
net/sf/vcaperture/services/YamlFilesystemStorageService.java113
net/sf/vcaperture/services/LuceneSearchService.java137
	public String getLastProcessedRevision(AbstractRepository repo) {
		File file = new File(getRepoStorageDirectory(repo), LATEST_VERSION_FILE);
		if (file.exists() && file.isFile()) {
			try {
				String rev = FileUtils.readFileToString(file);
				return rev == null ? repo.getNullRevisionDefault() : rev.trim();
			} catch (IOException ioe) {
				throw new StorageException("Error in storage mechanism: " + ioe.getMessage(), ioe);
			}
		}
		return repo.getNullRevisionDefault();
	}

	public void updateLatestStoredRevision(AbstractRepository repo, Revision rev) {
		File file = new File(getRepoStorageDirectory(repo), LATEST_VERSION_FILE);
		try {
			FileUtils.writeStringToFile(file, rev.getName());
		} catch (IOException ioe) {
			throw new StorageException("Error in storage mechanism: " + ioe.getMessage(), ioe);
		}
	}

	// IoC
	public File getStorageDirectory() {