public AProject getProject(String name) throws ProjectException { AProject lp; synchronized (localProjects) { lp = localProjects.get(name); } if (lp == null) { throw new ProjectException("Cannot find project ''{0}''!", null, name); } return lp; }
public String save() { try { getSelectedProject().save(); items = null; } catch (ProjectException e) { log.error("Failed to save changes", e); FacesUtils.addErrorMessage("Failed to save changes", e.getMessage()); } return null; }
private File downloadExelFile(AProjectArtefact excelArtefact) { if (excelArtefact == null) { return null; } InputStream in = null; try { in = ((AProjectResource) excelArtefact).getContent(); } catch (ProjectException e) { e.printStackTrace(); } File tempFile = null; OutputStream out = null; String filePrefix = ((excelArtefact.getAPI() instanceof LocalArtefactAPI) ? "uw" : selectedVersionRepo) + "_"; try { tempFile = new File(filePrefix + excelArtefact.getName()); out = new FileOutputStream(tempFile); IOUtils.copy(in, out); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(out); IOUtils.closeQuietly(in); } return tempFile; }
} catch (ProjectException e) { String message; if (e.getCause() instanceof FileNotFoundException) { if (e.getMessage().contains(".xls")) { message = "Failed to export the project. Please close module Excel file and try again."; } else {
} catch (ProjectException e) { String message; if (e.getCause() instanceof FileNotFoundException) { if (e.getMessage().contains(".xls")) { message = "Failed to export the project. Please close module Excel file and try again."; } else {
public InputStream getContent() throws ProjectException { try { return new FileInputStream(source); } catch (FileNotFoundException e) { throw new ProjectException("Failed to get content.", e); } }
public String close() { try { getSelectedProject().close(); items = null; } catch (ProjectException e) { LOG.error("Failed to close!", e); FacesUtils.addErrorMessage("failed to close deployment project", e.getMessage()); } return null; }
public void delete(CommonUser user) throws ProjectException { boolean success; try { if (source.isFile()) { success = source.delete(); } else { success = FolderHelper.deleteFolder(source); } } catch (Exception e) { throw new ProjectException("Failed to delete local resource", e); } if (!success) { throw new ProjectException("Failed to delete local resource"); } }
public String close() { try { getSelectedProject().close(); items = null; } catch (ProjectException e) { log.error("Failed to close!", e); FacesUtils.addErrorMessage("failed to close deployment project", e.getMessage()); } return null; }
private void checkName(String artefactName) throws ProjectException { if (!NameChecker.checkName(artefactName)) { throw new ProjectException("File or folder name '" + artefactName + "' is invalid. " + NameChecker.BAD_NAME_MSG); } }
public String checkIn() { try { getSelectedProject().checkIn(); items = null; } catch (ProjectException e) { LOG.error("Failed to check-in!", e); FacesUtils.addErrorMessage("failed to check in", e.getMessage()); } return null; }
public AProjectArtefact getArtefact(String name) throws ProjectException { AProjectArtefact artefact = getArtefactsInternal().get(name); if (artefact == null) { throw new ProjectException("Cannot find project artefact ''{0}''", null, name); } return artefact; }
public String save() { try { getSelectedProject().save(); items = null; } catch (ProjectException e) { log.error("Failed to save changes", e); FacesUtils.addErrorMessage("Failed to save changes", e.getMessage()); } return null; }
public LocalArtefactAPI getArtefact(String name) throws ProjectException { File[] files = source.listFiles(); if (files != null) { for (File file : files) { if (file.getName().equals(name)) { return getArtefactForChild(file); } } } throw new ProjectException(String.format("Artefact with name '%s' is" + " not found", name)); }
public String close() { try { getSelectedProject().close(); items = null; } catch (ProjectException e) { log.error("Failed to close!", e); FacesUtils.addErrorMessage("failed to close deployment project", e.getMessage()); } return null; }
private void checkName(String artefactName) throws ProjectException { if (!NameChecker.checkName(artefactName)) { throw new ProjectException("File or folder name '" + artefactName + "' is invalid. " + NameChecker.BAD_NAME_MSG); } }
public String open() { try { getSelectedProject().open(); items = null; } catch (ProjectException e) { log.error("Failed to open", e); FacesUtils.addErrorMessage("Failed to open", e.getMessage()); } return null; }
private void checkName(String artefactName) throws ProjectException { if (!NameChecker.checkName(artefactName)) { throw new ProjectException("File or folder name '" + artefactName + "' is invalid. " + NameChecker.BAD_NAME_MSG); } }
public String open() { try { getSelectedProject().open(); items = null; } catch (ProjectException e) { log.error("Failed to open", e); FacesUtils.addErrorMessage("Failed to open", e.getMessage()); } return null; }
public ADeploymentProject getDDProject(String name) throws ProjectException { refreshDeploymentProjects(); ADeploymentProject deploymentProject; synchronized (userDProjects) { deploymentProject = userDProjects.get(name); } if (deploymentProject == null) { throw new ProjectException("Cannot find deployment project ''{0}''", null, name); } return deploymentProject; }