Examples of Uploader


Examples of org.apache.hadoop.hbase.mapreduce.SampleUploader.Uploader

  @SuppressWarnings("unchecked")
  @Test
  public void testSampleUploader() throws Exception {

    Configuration configuration = new Configuration();
    Uploader uploader = new Uploader();
    Mapper<LongWritable, Text, ImmutableBytesWritable, Put>.Context ctx = mock(Context.class);
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        ImmutableBytesWritable writer = (ImmutableBytesWritable) invocation.getArguments()[0];
        Put put = (Put) invocation.getArguments()[1];
        assertEquals("row", Bytes.toString(writer.get()));
        assertEquals("row", Bytes.toString(put.getRow()));
        return null;
      }
    }).when(ctx).write(any(ImmutableBytesWritable.class), any(Put.class));

    uploader.map(null, new Text("row,family,qualifier,value"), ctx);

    Path dir = util.getDataTestDirOnTestFS("testSampleUploader");

    String[] args = { dir.toString(), "simpleTable" };
    Job job = SampleUploader.configureJob(configuration, args);
View Full Code Here

Examples of org.fcrepo.client.Uploader

                      String pass)
            throws MalformedURLException, ServiceException, IOException {

        AutoModify.s_APIM = apim;
        AutoModify.s_APIA = apia;
        AutoModify.s_UPLOADER = new Uploader(protocol, host, port, context, user, pass);

    }
View Full Code Here

Examples of org.fcrepo.client.Uploader

            PrintStream logFile;
            FedoraAPIMMTOM APIM;
            FedoraAPIAMTOM APIA;

            try {
                UPLOADER = new Uploader(host, port, context, user, pass);
                logFile =
                        new PrintStream(new FileOutputStream("C:\\zlogfile.txt"));
                //APIM = org.fcrepo.client.APIMStubFactory.getStub(protocol, host, port, user, pass);
                //APIA = org.fcrepo.client.APIAStubFactory.getStub(protocol, host, port, user, pass);
View Full Code Here

Examples of org.jboss.seam.wiki.core.upload.Uploader

            mimeType = Magic.getMagicMatch(uncompressedBytes).getMimeType();
        } catch (Exception ex) {}
        String contentType = mimeType != null ? mimeType : UploadTypes.DEFAULT_UPLOAD_TYPE;

        // Just a temporary value holder this time
        Uploader uploader = new Uploader();
        uploader.setData(uncompressedBytes);
        uploader.setFilename(zipEntry.getName());
        uploader.setContentType(contentType);

        // Get the right handler for that type and produce a WikiUpload instance
        UploadType uploadType = uploadTypes.get(contentType);
        if (uploadType == null) uploadType = uploadTypes.get(UploadTypes.GENERIC_UPLOAD_TYPE);
        WikiUpload wikiUpload = uploadType.getUploadHandler().handleUpload(uploader);
View Full Code Here

Examples of org.jboss.seam.wiki.core.upload.Uploader

                setParameter("cid", conversationId);
            }

            protected void invokeApplication() throws Exception {

                Uploader uploader = (Uploader) getInstance(Uploader.class);

                assert uploader.getParentDirectoryId().equals(2l);

                byte[] uploadData = getBinaryFile("testupload2.zip");
                uploader.setData(uploadData);
                uploader.setContentType("application/zip");
                uploader.setFilename("testupload2.zip");

                assert uploader.uploadNewInstance().equals("WikiUpload");

                assert uploader.getUpload().getContentType().equals("application/zip");
                assert uploader.getUpload().getFilesize() == uploadData.length;
                assert uploader.getUpload().getFilename().equals("testupload2.zip");
                assert uploader.getUpload().getFilenameWithoutExtension().equals("testupload2");
                assert uploader.getUpload().getExtension().equals("zip");
                assert uploader.getUpload().getData() == uploadData;

            }

        }.run();
View Full Code Here

Examples of org.sgx.yuigwt.yui.uploader.Uploader

public void test(final Node parent) {
YUI.Use(new String[]{"uploader", "console"}, new YUICallback() {

  @Override
  public void ready(final YuiContext Y) {
    final Uploader uploader1 = Y.newUploader(UploaderConfig.create()
      .multipleFiles(true)
      .swfURL("http://yui.yahooapis.com/3.7.3/build/uploader/assets/flashuploader.swf?t=" + Math.random())
      .uploadURL("http://www.yswfblog.com/upload/simpleupload.php")
      .simLimit(2)
      .withCredentials(false)
      .width("200px")
      .height("100px")
    );
//    uploader1.render(parent);
    final Console console = Y.newConsole().render().cast();
   
    final Node selectFilesButtonContainer = parent.appendChild("<div></div>");
   
   
    //if html5 add support from drag&drop files from desktop. see http://yuilibrary.com/yui/docs/uploader/uploader-dd.html
    if(Y.Uploader().TYPE().equals("html5")) {
     
      final Node uploaderMessage = parent.appendChild("<div>Drag and drop files</div>");
      final Node ddarea = parent.appendChild("<div>on this BOX</div>");
      uploader1.set("dragAndDropArea", ddarea);
      console.log("html5 uploader");
     
      uploader1.on(new String[]{UploaderHTML5.EVENT_DRAGENTER, UploaderHTML5.EVENT_DRAGOVER}, new EventCallback<UploaderEvent>() {
        @Override
        public void call(UploaderEvent e) {
          uploaderMessage.text("Files detected, drop them here!");
        }
      });
     
      uploader1.on(new String[]{UploaderHTML5.EVENT_DRAGLEAVE, UploaderHTML5.EVENT_DROP}, new EventCallback<UploaderEvent>() {
        @Override
        public void call(UploaderEvent e) {
          uploaderMessage.text("Drag and drop files here");
        }
      });
     
    }
    else if(Y.Uploader().TYPE().equals("flash")) {
      console.log("flash uploader");
    }
    else {
      console.log("file uploader not supported - "+"No Flash or HTML5 capabilities detected.");
      return;
    }
   
   
    uploader1.render(selectFilesButtonContainer);
   
    uploader1.after("fileselect", new EventCallback<UploaderEvent>() {
      @Override
      public void call(UploaderEvent e) {
        JsArray<File> fl = e.fileList(); //uploader1.fileList() 
        console.log("fileselect: "+fl.length());
      }
View Full Code Here

Examples of org.uengine.util.ftp.Uploader

           
      copy.write();
      copy.close();
System.out.println("  ExcelSheetActivity:getWIHAddress: upload the copy: " + tempFName);
   
    Uploader uploader = new Uploader();
    uploader.connect(uploadFTPAddress, getFTPid(), getFTPpw());
    uploader.uploadFile(tempFName, getUploadFTPDirectory() + "/" + tempFName);  
    is.close();
    workbook.close()

    super.executeActivity(instance);
  }
View Full Code Here

Examples of org.uengine.util.ftp.Uploader

    String _directory   = evaluateContent(instance, getDirectory()).toString();
    String _account   = evaluateContent(instance, getAccount()).toString();
    String _password   = evaluateContent(instance, getPassword()).toString();
    String _fileName   = evaluateContent(instance, getFileName()).toString();
   
    Uploader uploader = new Uploader();
    uploader.connect(_address, _account, _password);
    uploader.uploadFile(_sourceURL, _directory + "/" + _fileName);
   
    fireComplete(instance);   
  }
View Full Code Here

Examples of org.uengine.util.ftp.Uploader

      }
           
      copy.write();
      copy.close();
   
    Uploader uploader = new Uploader();
    uploader.connect(defaultValue.getFtpAddress(), defaultValue.getFtpUserId(), defaultValue.getFtpPassword());
    uploader.uploadFile(tempFName, defaultValue.getFtpDirectory() + "/" + tempFName);  

    setPath(defaultValue.getFullSavingFTPURL(instance));
   
    is.close();
    workbook.close();     
View Full Code Here

Examples of org.zkoss.zss.ui.impl.Uploader

    _spreadsheet.addEventListener(Events.ON_CELL_DOUBLE_CLICK, _doClearClipboard);
    _spreadsheet.addEventListener(Events.ON_START_EDITING, _doClearClipboard);
   
    if (_upload == null) {
      _upload = new Upload();
      _upload.appendChild(_insertPicture = new Uploader());
      _insertPicture.addEventListener(org.zkoss.zk.ui.event.Events.ON_UPLOAD, new EventListener() {
       
        @Override
        public void onEvent(Event event) throws Exception {
          doInsertPicture((UploadEvent)event);
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.