Esempio n. 1
0
  public boolean deleteCdaFile(final String path, final String solution, final String file)
      throws Exception {
    // TODO: Validate the filename in some way, shape or form!
    IRepositoryAccess repository = CdaEngine.getEnvironment().getRepositoryAccess();
    // final ICommonParameterProvider requestParams = requParam;
    // Check if the file exists and we have permissions to write to it
    String relativePath = getRelativePath(path, solution, file);

    if (repository.canWrite(relativePath)) {
      return repository.removeFileIfExists(relativePath);
    } else {
      throw new AccessDeniedException(relativePath, null);
    }
  }