Package com.intridea.io.vfs.operations

Examples of com.intridea.io.vfs.operations.IPublicUrlsGetter


    public void getUrls() throws FileSystemException {
        FileObject backup = fsManager.resolveFile("s3://" + bucketName + "/test-place/backup.zip");

        assertTrue(backup.getFileOperations().hasOperation(IPublicUrlsGetter.class));

        IPublicUrlsGetter urlsGetter = (IPublicUrlsGetter) backup.getFileOperations().getOperation(IPublicUrlsGetter.class);

        assertEquals(urlsGetter.getHttpUrl(), "http://" + bucketName + ".s3.amazonaws.com/test-place/backup.zip");
        assertTrue(urlsGetter.getPrivateUrl().endsWith("@" + bucketName + "/test-place/backup.zip"));

        final String signedUrl = urlsGetter.getSignedUrl(60);

        assertTrue(
            signedUrl.startsWith("https://" + bucketName + ".s3.amazonaws.com/test-place/backup.zip?"),
            signedUrl);
        assertTrue(signedUrl.indexOf("Signature=") != (-1));
View Full Code Here

TOP

Related Classes of com.intridea.io.vfs.operations.IPublicUrlsGetter

Copyright © 2018 www.massapicom. 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.