Uploading an Asset

client = FXAssetManagementClient.builder()
    .withRegion(Regions.EU_WEST_1)
    .build();

File f = new File("file-to-upload.mp4");
byte[] bytes = new byte[(int) f.length()];
FileInputStream is = new FileInputStream(f);

int offset = 0;
int numRead = 0;

try {
    while(offset < bytes.length
            && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
        offset += numRead;
    }
} finally {
    is.close();
}

UploadResponse result = client.uploadAsset("SOME-PROJECT-ID", "test.mp4", bytes);
System.out.printf("Upload %s\n", result.toString());

Terms of Use | © 2017, Impossible Software, or its affiliates. All rights reserved.