All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pathomation.Upload_Test Maven / Gradle / Ivy

package com.pathomation;

import java.util.*;

import static java.lang.System.out;

public class Upload_Test {
    public static void main(String[] args) throws InterruptedException {
        String localSourceSlidePng = "C:\\Slides\\download_check\\down\\test.png";
        String localSourceSlideZif = "C:\\Slides\\download_check\\down\\2DollarBill.zif";
        String localSourceSlideSvs = "C:\\Slides\\download_check\\down\\CMU-11.svs";
        String localSourceSlideNdpi = "C:\\Slides\\download_check\\down\\indp.ndpi";
        String localSourceSlideJpg = "C:\\Slides\\download_check\\down\\dog.jpg";
        String localSourceSlideTiff = "C:\\Slides\\download_check\\down\\testTif.tiff";
        String localSourceSlideSzi = "C:\\Slides\\download_check\\down\\2DollarBill2.szi";
        String localSourceSlideVsi = "C:\\Slides\\a\\UGent.vsi";
        String localSourceSlideMrxs = "C:\\Slides\\download_check\\down\\CMU-1.mrxs";
        String ets = "Alfred_Olympus_VS120_brightfield_all-in-one\\stack1\\frame_t.ets";

        String targetFolder = "_sys_aws_s3/AuploadCheck";

        Thread getter = new Thread() {
            @Override
            public void run() {
                ProgressHttpEntityWrapper.ProgressCallback progressCallbackZif = new ProgressHttpEntityWrapper.ProgressCallback() {
                    public void progress(long bytesRead, long transferred, long totalBytes, String filename) {
                        try {
                            Core.bytes.put(bytesRead);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                        System.out.println(bytesRead + "  bytesRead-----");
                        System.out.println("totalBytes: " + totalBytes);
                        float progress = ((float) transferred / totalBytes) * 100;
                        System.out.println(filename + ": " + transferred + " (" + progress + " %)");
                    }
                };
                try {
                    Core.upload(localSourceSlideZif, targetFolder, Core.connect("https://devtest.pathomation.com/test/pma.core.3/", "vitalij", "PMI9GH9I"), progressCallbackZif);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        };
        Thread setter = new Thread() {
            @Override
            public void run() {
                while (true) {
                    out.println(Upload_Test.getUploadInfo() + " Upload_Test.getUploadInfo()Upload_Test.getUploadInfo()Upload_Test.getUploadInfo()Upload_Test.getUploadInfo()");
                }
            }
        };
        getter.start();
        //setter.start();
        while (true) {
            out.println(Upload_Test.getUploadInfo() + " Upload_Test.getUploadInfo()Upload_Test.getUploadInfo()Upload_Test.getUploadInfo()Upload_Test.getUploadInfo()");
        }
    }

    public static Long getUploadInfo() {
        try {
            return Core.bytes.take();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy