@Override protected List<FileData> getHistoryFileDatas() { if (historyFileDatas == null) { try { if (designFolderName != null) { historyFileDatas = designRepository.listHistory(designFolderName); } else { // Local repository doesn't have versions historyFileDatas = Collections.emptyList(); } } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } } return historyFileDatas; }
protected ProjectVersion getVersion(int index) { List<FileData> fileDatas; try { fileDatas = getRepository().listHistory(getFileData().getName()); } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } return fileDatas.isEmpty() ? null : createProjectVersion(fileDatas.get(index)); }
public ProjectVersion getLastVersion() { List<FileData> fileDatas; try { fileDatas = getRepository().listHistory(getFileData().getName()); } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } return fileDatas.isEmpty() ? createProjectVersion(null) : createProjectVersion(fileDatas.get(fileDatas.size() - 1)); }
public List<ProjectVersion> getArtefactVersions(ArtefactPath artefactPath) { String subPath = artefactPath.getStringValue(); if (subPath.isEmpty() || subPath.equals("/")) { return getVersions(); } if (!subPath.startsWith("/")) { subPath += "/"; } String fullPath = getFolderPath() + subPath; Collection<FileData> fileDatas; try { fileDatas = getRepository().listHistory(fullPath); } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } List<ProjectVersion> versions = new ArrayList<>(); for (FileData data : fileDatas) { versions.add(createProjectVersion(data)); } return versions; }
protected List<FileData> getHistoryFileDatas() { if (historyFileDatas == null) { try { String folderPath = getFolderPath(); if (folderPath != null && isRepositoryVersionable()) { historyFileDatas = getRepository().listHistory(folderPath); } else { // File repository doesn't have versions historyFileDatas = Collections.emptyList(); } } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } } return historyFileDatas; }
public List<ProjectVersion> getVersions() { if (getFileData() == null) { return Collections.emptyList(); } Collection<FileData> fileDatas; try { fileDatas = getRepository().listHistory(getFileData().getName()); } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } List<ProjectVersion> versions = new ArrayList<>(); for (FileData data : fileDatas) { versions.add(createProjectVersion(data)); } return versions; }
public int getVersionsCount() { try { return getFileData() == null ? 0 : getRepository().listHistory(getFileData().getName()).size(); } catch (IOException ex) { throw RuntimeExceptionWrapper.wrap(ex); } }