Ejemplo n.º 1
0
  private static UploadInfo getUploadInfo(models.Upload upload, File uploadsDir, User user) {
    List<File> uploadedFiles = new ArrayList<File>();
    collectFiles(uploadsDir, uploadedFiles);

    List<Module> modules = new ArrayList<Module>();
    List<Diagnostic> diagnostics =
        ModuleChecker.collectModulesAndDiagnostics(
            uploadedFiles, modules, uploadsDir, user, upload);

    return new UploadInfo(upload, modules, diagnostics);
  }
Ejemplo n.º 2
0
  public static void view(Long id) throws IOException {
    models.Upload upload = getUpload(id);
    User user = getUser();
    File uploadsDir = Util.getUploadDir(id);
    List<File> uploadedFiles = new ArrayList<File>();
    collectFiles(uploadsDir, uploadedFiles);

    List<Module> modules = new ArrayList<Module>();
    List<Diagnostic> diagnostics =
        ModuleChecker.collectModulesAndDiagnostics(
            uploadedFiles, modules, uploadsDir, user, upload);

    UploadInfo uploadInfo = new UploadInfo(upload, modules, diagnostics);

    String base = uploadsDir.getPath();
    render("Uploads/view.html", upload, uploadInfo, uploadedFiles, base);
  }