Skip to content

Commit 7dfcd27

Browse files
committed
---
yaml --- r: 1011 b: refs/heads/master c: 286065d h: refs/heads/master i: 1009: 8c98618 1007: b16e8a3 v: v3
1 parent 73d5363 commit 7dfcd27

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
refs/heads/master: d60d3f458c4f0b253f12bba5a448192b7c15e5d4
2+
refs/heads/master: 286065de0e2641314ba76cd1721816855e7e2ed7
33
refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44
refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99

trunk/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import java.util.Calendar;
5656
import java.util.HashMap;
5757
import java.util.Map;
58+
import java.util.concurrent.TimeUnit;
5859

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

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

509507
@Override

0 commit comments

Comments
 (0)