Examples of selectFile()


Examples of com.meterware.httpunit.PostMethodWebRequest.selectFile()

  public void testSendFile() throws Exception {
    //TODO test with url parameters (i.e. a=b); but HttpUnit is faulty so we can't
    final PostMethodWebRequest request = new PostMethodWebRequest(
            rewriteMakeMethodUrl("http://localhost/proxyMe"), true);//true: mime encoded
    InputStream data = new ByteArrayInputStream("testFileData".getBytes("UTF-8"));
    request.selectFile("fileNameParam", "fileName", data, "text/plain");
    WebResponse rsp = execAndAssert(request);
    assertTrue(rsp.getText().contains("Content-Type: multipart/form-data; boundary="));
  }

  @Test
View Full Code Here

Examples of com.meterware.httpunit.PostMethodWebRequest.selectFile()

        for (int i = 0; i < params.length; i += 2) {
            String key = (String) params[i];
            Object value = params[i + 1];

            if (value instanceof File) {
                post.selectFile(key, (File) value);
            } else if (value instanceof File[]) {
                UploadFileSpec[] specs = new UploadFileSpec[((File[]) value).length];

                for (int j = 0; j < ((File[]) value).length; j++) {
                    specs[j] = new UploadFileSpec(((File[]) value)[j]);
View Full Code Here

Examples of com.meterware.httpunit.PostMethodWebRequest.selectFile()

        for (int i = 0; i < params.length; i += 2) {
            String key = (String) params[i];
            Object value = params[i + 1];

            if (value instanceof File) {
                post.selectFile(key, (File) value);
            } else if (value instanceof File[]) {
                UploadFileSpec[] specs = new UploadFileSpec[((File[]) value).length];

                for (int j = 0; j < ((File[]) value).length; j++) {
                    specs[j] = new UploadFileSpec(((File[]) value)[j]);
View Full Code Here

Examples of com.meterware.httpunit.WebRequest.selectFile()

        // 取得提交form的request
        WebRequest request = form.getRequest();

        request.setParameter("myparam", "中华人民共和国");
        request.selectFile("myfile", new File(srcdir, "smallfile.txt"));

        File nonAsciiFile = 中文文件名;

        if (nonAsciiFile.exists()) {
            request.selectFile("myfile_中文", nonAsciiFile);
View Full Code Here

Examples of com.meterware.httpunit.WebRequest.selectFile()

        request.selectFile("myfile", new File(srcdir, "smallfile.txt"));

        File nonAsciiFile = 中文文件名;

        if (nonAsciiFile.exists()) {
            request.selectFile("myfile_中文", nonAsciiFile);
        } else {
            fail("Could not find non-ascii filename: " + nonAsciiFile.getAbsolutePath()
                 + ".  Please make sure the OS charset is correctly set.");
        }
View Full Code Here

Examples of com.mucommander.ui.main.table.FileTable.selectFile()

                    if(!randomChild.isBrowsable())
                        continue;
                    // Try to ls() in RandomChild to trigger an IOException if folder is not readable
                    // so that no error dialog pops up when calling tryChangeCurrentFolder()
                    randomChild.ls();
                    fileTable.selectFile(randomChild);
                    ActionManager.performAction(com.mucommander.ui.action.impl.OpenAction.Descriptor.ACTION_ID, mainFrame);
                    //          folderPanel.tryChangeCurrentFolder(randomChild, true);
                }
            }
            catch(Exception e) {
View Full Code Here

Examples of com.trolltech.qt.gui.QFileDialog.selectFile()

    int pos = name.lastIndexOf(Global.attachmentNameDelimeter);
    if (pos > -1) {
      guid = name.substring(0, pos).replace("nnres://", "");
      name = name.substring(pos +Global.attachmentNameDelimeter.length());
      fd.selectFile(name);
      pos = name.lastIndexOf('.');
      if (pos > -1) {
        String mimeType = "(*." + name.substring(pos + 1)
            + ");; All Files (*)";
        fd.setFilter(tr(mimeType));
 
View Full Code Here

Examples of com.trolltech.qt.gui.QFileDialog.selectFile()

      guid = guid.substring(0,pos);
    }
    pos = name.lastIndexOf(Global.attachmentNameDelimeter);
    if (pos > -1) {
      guid = name.substring(0, pos);
      fd.selectFile(name.substring(pos+Global.attachmentNameDelimeter.length()));   
    }
    if (fd.exec() != 0 && fd.selectedFiles().size() > 0) {
      Resource resBinary = conn.getNoteTable().noteResourceTable.getNoteResource(guid, true);
      String fileName = fd.selectedFiles().get(0);
      QFile saveFile = new QFile(fileName);
View Full Code Here

Examples of flanagan.io.FileChooser.selectFile()

    // Read from file
    // Choose file from file chooser window
    public void readFromFile(){
        this.setDataOneDone = false;
        FileChooser fin = new FileChooser();
        this.dataFilename = fin.selectFile();
        this.read(fin);
    }

    // Read from file
    // file name supplied
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.