Examples of addFile()


Examples of org.springframework.mock.web.MockMultipartHttpServletRequest.addFile()

    assertFalse(request.getFileNames().hasNext());
    assertNull(request.getFile("file1"));
    assertNull(request.getFile("file2"));
    assertTrue(request.getFileMap().isEmpty());

    request.addFile(new MockMultipartFile("file1", "myContent1".getBytes()));
    request.addFile(new MockMultipartFile("file2", "myOrigFilename", "text/plain", "myContent2".getBytes()));
    doTestMultipartHttpServletRequest(request);
  }

  public void testMockMultipartHttpServletRequestWithInputStream() throws IOException {
View Full Code Here

Examples of org.springframework.mock.web.test.MockMultipartHttpServletRequest.addFile()

  }

  @Test
  public void handleRequestPart() throws Exception {
    MockMultipartHttpServletRequest multipartRequest = new MockMultipartHttpServletRequest();
    multipartRequest.addFile(new MockMultipartFile("requestPart", "", "text/plain", "content".getBytes("UTF-8")));

    HandlerMethod handlerMethod = handlerMethod("handleRequestPart", String.class, Model.class);
    ModelAndView mav = handlerAdapter.handle(multipartRequest, response, handlerMethod);

    assertNotNull(mav);
View Full Code Here

Examples of org.tmatesoft.svn.core.io.ISVNEditor.addFile()

        public void applyAction( Object context ) throws Exception {
            ISVNEditor editor = (ISVNEditor)context;
            openDirectories(editor, path);

            editor.addFile(path + "/" + file, null, -1);
            editor.applyTextDelta(path + "/" + file, null);
            SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
            String checksum = deltaGenerator.sendDelta(path + "/" + file, new ByteArrayInputStream(this.content), editor, true);
            editor.closeFile(path + "/" + file, checksum);
View Full Code Here

Examples of se.gu.fire.core.Submission.addFile()

        assertEquals(SubmissionStatus.New, sm.getAssignmentStatus(assign, group));

        Comment com = new Comment(u2, "Total katastrof! Bara Christopher kan rädda dig nu");

        sub.addComments(com);
        sub.addFile(new StoredFile("Hacker.java", text, "text/plain"));
        Submission sub2 = sm.read(sub.getId());

        assertEquals(sub, sub2);

        // Test setSubmissionStatus()
View Full Code Here

Examples of slash.navigation.rest.Post.addFile()

    public String sendChecksums(DataSource dataSource, Map<FileAndChecksum, List<FileAndChecksum>> fileAndChecksums, String... filterUrls) throws IOException {
        String xml = createDataSourceXml(dataSource, fileAndChecksums, filterUrls);
        log.info(format("Sending checksums for %s filtered with %s:\n%s", fileAndChecksums, printArrayToDialogString(filterUrls), xml));
        Post request = new Post(getDataSourcesUrl(), credentials);
        request.addFile("file", xml.getBytes());

        String result = request.executeAsString();
        if (request.isUnAuthorized())
            throw new UnAuthorizedException("Cannot send checksums ", getDataSourcesUrl());
        if (!request.isSuccessful())
View Full Code Here

Examples of slash.navigation.rest.Put.addFile()

    private Put updateCategory(String key, String name,
                               String authenticationUserName, String authenticationPassword) throws IOException, JAXBException {
        String xml = createCategoryXml(name);

        Put request = new Put(CATEGORIES_URL + encodeUri(key) + GPX_URL_POSTFIX, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", writeToTempFile(xml));
        return request;
    }

    private Put updateCategory(String key, String name) throws IOException, JAXBException {
        return updateCategory(key, name, USERNAME, PASSWORD);
View Full Code Here

Examples of uk.gov.nationalarchives.droid.AnalysisController.addFile()

            e.printStackTrace();
            log.severe("Failed to read sig file");
        }
        log.info("Attempting to identify " + tempFile.getAbsolutePath());
        log.info("File is of length " + tempFile.length());
        controller.addFile(tempFile.getAbsolutePath());
        controller.setVerbose(false);
        controller.runFileFormatAnalysis();
        Iterator<IdentificationFile> iterator = controller.getFileCollection()
                .getIterator();
        // We identify one file only:
View Full Code Here

Examples of v7db.files.mongodb.V7GridFS.addFile()

  }

  public void testCopyFile() throws IOException {
    V7GridFS fs = new V7GridFS(getMongo().getDB("test"));
    ObjectId dir = fs.addFolder("test", "folder");
    fs.addFile("test".getBytes(), dir, "test.txt", "text/plain");

    CopyCommand.main(new String[] { "copy", "test", "folder/test.txt", "x",
        "copy.txt" });

    V7File file = fs.getFile("x", "copy.txt");
View Full Code Here

Examples of workspace.elements.HaxeProject.addFile()

                    String extention = resource.getFileExtension();
                    if (CodeFile.EXTENTION.equalsIgnoreCase(extention))
                    {
                        project =
                                manager.getProject(resource.getProject().getName());
                        project.addFile((IFile)resource);
                    }
                    else if (BuildFile.EXTENTION.equalsIgnoreCase(extention))
                    {
                        project =
                                manager.getProject(resource.getProject().getName());
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.