Skip to content

Commit

Permalink
Update storage example
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Oct 12, 2015
1 parent bf10abc commit f6b7ac9
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
* An example of using the Google Cloud Storage.
Expand Down Expand Up @@ -499,11 +500,8 @@ public void run(Storage storage, Tuple<ServiceAccountAuthCredentials, Blob> tupl

private void run(Storage storage, ServiceAccountAuthCredentials cred, Blob blob)
throws IOException {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 1);
long expiration = cal.getTimeInMillis() / 1000;
System.out.println("Signed URL: " +
blob.signUrl(expiration, SignUrlOption.serviceAccount(cred)));
blob.signUrl(1, TimeUnit.DAYS, SignUrlOption.serviceAccount(cred)));
}

@Override
Expand Down

0 comments on commit f6b7ac9

Please sign in to comment.