Examples of File


Examples of org.dspace.app.xmlui.wing.element.File

      {
        // Only add the upload capabilities for new item submissions
        upload = div.addList("submit-upload-new", List.TYPE_FORM);
          upload.setHead(T_head);   
         
          File file = upload.addItem().addFile("file");
          file.setLabel(T_file);
          file.setHelp(T_file_help);
          file.setRequired();
         
          //if no files found error was thrown by processing class, display it!
          if (this.errorFlag==org.dspace.submit.step.UploadStep.STATUS_NO_FILES_ERROR)
          {
                file.addError(T_file_error);
            }

            // if an upload error was thrown by processing class, display it!
            if (this.errorFlag == org.dspace.submit.step.UploadStep.STATUS_UPLOAD_ERROR)
            {
                file.addError(T_upload_error);
            }
           
          Text description = upload.addItem().addText("description");
          description.setLabel(T_description);
          description.setHelp(T_description_help);
View Full Code Here

Examples of org.eclipse.core.internal.resources.File

    private void launch(Object[] elements, String mode)
    {
        try
        {
            File elementToLaunch = null;

            if (elements.length == 1)
            {
                Object selected = elements[0];
                if (selected instanceof File)
View Full Code Here

Examples of org.evolizer.model.resources.entities.fs.File

   *
   */
  @Test
  public void testFiles(){
//    testing file layout/generic/nsViewportFrame.cpp
    File f = fSession.uniqueResult("from VersionedFile as file where file.path = '/cvsroot/mozilla/layout/generic/nsViewportFrame.cpp'", File.class);
    assertEquals("nsViewportFrame.cpp",f.getName());
    assertEquals("/cvsroot/mozilla/layout/generic",f.getParentDirectory().getPath());
    //testing file layout/generic/nsViewportFrame.h
    File f2 = fSession.uniqueResult("from VersionedFile as file where file.path = '/cvsroot/mozilla/layout/generic/nsViewportFrame.h'", File.class);
    assertEquals("nsViewportFrame.h",f2.getName());
    assertEquals("/cvsroot/mozilla/layout/generic",f2.getParentDirectory().getPath());
    //testinig file layout/generic/punct_marks.ccmap

    File f3 = fSession.uniqueResult("from VersionedFile as file where file.path = '/cvsroot/mozilla/layout/generic/punct_marks.ccmap'", File.class);
    assertEquals("punct_marks.ccmap",f3.getName());
    assertEquals("/cvsroot/mozilla/layout/generic",f3.getParentDirectory().getPath());
  }
View Full Code Here

Examples of org.fenixedu.academic.domain.File

    @Override
    public ActionForward execute(final ActionMapping mapping, final ActionForm actionForm, final HttpServletRequest request,
            final HttpServletResponse response) throws Exception {
        final String oid = request.getParameter("oid");
        final File file = FenixFramework.getDomainObject(oid);
        if (file == null) {
            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            response.getWriter().write(HttpStatus.getStatusText(HttpStatus.SC_BAD_REQUEST));
            response.getWriter().close();
        } else {
            final Person person = AccessControl.getPerson();
            if (!file.isPrivate() || file.isPersonAllowedToAccess(person)) {
                response.setContentType(file.getContentType());
                response.addHeader("Content-Disposition", "attachment; filename=" + file.getFilename());
                response.setContentLength(file.getSize().intValue());
                final DataOutputStream dos = new DataOutputStream(response.getOutputStream());
                dos.write(file.getContents());
                dos.close();
            } else if (file.isPrivate() && person == null) {
                response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
                response.getWriter().write(HttpStatus.getStatusText(HttpStatus.SC_UNAUTHORIZED));
                response.getWriter().close();
            } else {
                response.setStatus(HttpServletResponse.SC_FORBIDDEN);
View Full Code Here

Examples of org.formic.util.File

        // filter out dirs the user doesn't have permission write to.
        ArrayList<String> filtered = new ArrayList<String>();
        if (runtimePath != null){
          for (String path : runtimePath){
            if (new File(path).canWrite()){
              if (Installer.isUninstall()){
                File eclimDir = new File(path + "/eclim");
                if (eclimDir.exists()){
                  if (eclimDir.canWrite()){
                    filtered.add(path);
                  }else{
                    logger.warn(
                        path + "/eclim is not writable by the current user");
                  }
                }
              }else{
                filtered.add(path);
              }
            }
          }
        }
        String[] rtp = filtered.toArray(new String[filtered.size()]);

        if(rtp == null || rtp.length == 0){
          if(!Installer.isUninstall()){
            if(!homeVimCreatePrompted){
              createUserVimFiles("No suitable vim files directory found.");
            }else{
              GuiDialogs.showWarning(
                  "Your vim install is still reporting no\n" +
                  "suitable vim files directories.\n" +
                  "You will need to manually specify one.");
            }
          }
        }else{
          if(rtp.length == 1){
            fileChooser.getTextField().setText(rtp[0]);

            // try to discourage windows users from installing eclim files in
            // their vim installation.
            if(new File(rtp[0] + "/gvim.exe").exists()){
              createUserVimFiles("No user vim files directory found.");
            }
          }else{
            dirList = new JList(rtp);
            dirList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.File

    return keyPairsContainer;
  }

  private Link getUploadLinkForMedia(Media emptyMedia) {
    File uploadFile = getFirst(emptyMedia.getFiles(), null);
    assertNotNull(uploadFile,
        String.format(OBJ_FIELD_REQ, MEDIA, "files.first"));
    assertEquals(uploadFile.getSize(), Long.valueOf(0));
    assertEquals(uploadFile.getSize().longValue(), emptyMedia.getSize(),
        String.format(OBJ_FIELD_EQ, MEDIA, "uploadFile.size()",
            emptyMedia.getSize(), uploadFile.getSize()));

    Set<Link> links = uploadFile.getLinks();
    assertNotNull(links,
        String.format(OBJ_FIELD_REQ, MEDIA, "uploadFile.links"));
    assertTrue(links.size() >= 1, String.format(OBJ_FIELD_LIST_SIZE_GE,
        MEDIA, "uploadfile.links", 1, links.size()));
    assertTrue(Iterables.all(links, Predicates.or(
View Full Code Here

Examples of org.jivesoftware.smackx.packet.StreamInitiation.File

                        } catch (ParseException e) {
                            // couldn't parse date, use current date-time
                        }
                    }
                   
                    File file = new File(name, fileSize);
          file.setHash(hash);
          file.setDate(fileDate);
          file.setDesc(desc);
          file.setRanged(isRanged);
          initiation.setFile(file);
        }
      }
    }
View Full Code Here

Examples of org.kohsuke.github.GHCommit.File

        GHCommit commit = gitHub.getUser("jenkinsci").getRepository("jenkins").getCommit("08c1c9970af4d609ae754fbe803e06186e3206f7");
        System.out.println(commit);
        assertEquals(1, commit.getParents().size());
        assertEquals(1,commit.getFiles().size());

        File f = commit.getFiles().get(0);
        assertEquals(48,f.getLinesChanged());
        assertEquals("modified",f.getStatus());
        assertEquals("changelog.html", f.getFileName());
    }
View Full Code Here

Examples of org.nxplanner.file.File

                InputStream input = formFile.getInputStream();
                int fileSize = formFile.getFileSize();
                int projectId = request.getParameter("projectId") != null ?
                        Integer.parseInt(request.getParameter("projectId")) : 0;
                Directory directory = fileSystem.getDirectory("/attachments/project/"+projectId);
                File file = fileSystem.createFile(directory, filename, contentType, fileSize, input);
                note.setFile(file);

                Logger.getLogger(EditNoteAction.class).debug("Saving note: filename="
                        + filename + ", fileSize=" + fileSize + ", contentType=" + contentType);
View Full Code Here

Examples of org.osforce.connect.entity.document.File

      model.put("question", question);
    } else if(StringUtils.equals(Answer.NAME, activity.getEntity())) {
      Answer answer = answerService.getAnswer(activity.getLinkedId());
      model.put("answer", answer);
    } else if(StringUtils.equals(File.NAME, activity.getEntity())) {
      File file = fileService.getFile(activity.getLinkedId());
      model.put("file", file);
    } else if(StringUtils.equals(Folder.NAME, activity.getEntity())) {
      Folder folder = folderService.getFolder(activity.getLinkedId());
      model.put("folder", folder);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.