@@ -117,14 +117,14 @@ private static class InfoAction extends BlobsAction {
117117 public void run (StorageService storage , Blob ... blobs ) {
118118 if (blobs .length == 1 ) {
119119 if (blobs [0 ].name ().isEmpty ()) {
120- System .out .println (storage .get (Bucket . of ( blobs [0 ].bucket () )));
120+ System .out .println (storage .get (blobs [0 ].bucket ()));
121121 } else {
122- System .out .println (storage .get (blobs [0 ]));
122+ System .out .println (storage .get (blobs [0 ]. bucket (), blobs [ 0 ]. name () ));
123123 }
124124 } else {
125125 BatchRequest .Builder batch = BatchRequest .builder ();
126126 for (Blob blob : blobs ) {
127- batch .get (blob );
127+ batch .get (blob . bucket (), blob . name () );
128128 }
129129 BatchResponse response = storage .apply (batch .build ());
130130 System .out .println (response .gets ());
@@ -149,11 +149,11 @@ private static class DeleteAction extends BlobsAction {
149149 @ Override
150150 public void run (StorageService storage , Blob ... blobs ) {
151151 if (blobs .length == 1 ) {
152- System .out .println (storage .delete (blobs [0 ]));
152+ System .out .println (storage .delete (blobs [0 ]. bucket (), blobs [ 0 ]. name () ));
153153 } else {
154154 BatchRequest .Builder batch = BatchRequest .builder ();
155155 for (Blob blob : blobs ) {
156- batch .delete (blob );
156+ batch .delete (blob . bucket (), blob . name () );
157157 }
158158 BatchResponse response = storage .apply (batch .build ());
159159 System .out .println (response .deletes ());
@@ -236,7 +236,7 @@ private static class DownloadAction extends StorageAction<Tuple<Blob, Path>> {
236236
237237 @ Override
238238 public void run (StorageService storage , Tuple <Blob , Path > tuple ) throws IOException {
239- Blob blob = storage .get (tuple .x ());
239+ Blob blob = storage .get (tuple .x (). bucket (), tuple . x (). name () );
240240 if (blob == null ) {
241241 System .out .println ("No such object" );
242242 return ;
@@ -246,9 +246,9 @@ public void run(StorageService storage, Tuple<Blob, Path> tuple) throws IOExcept
246246 writeTo = new PrintStream (new FileOutputStream (tuple .y ().toFile ()));
247247 }
248248 if (blob .size () < 1024 ) {
249- writeTo .write (storage .load (blob ));
249+ writeTo .write (storage .load (blob . bucket (), blob . name () ));
250250 } else {
251- try (BlobReadChannel reader = storage .reader (blob )) {
251+ try (BlobReadChannel reader = storage .reader (blob . bucket (), blob . name () )) {
252252 WritableByteChannel channel = Channels .newChannel (writeTo );
253253 ByteBuffer bytes = ByteBuffer .allocate (64 * 1024 );
254254 while (reader .read (bytes ) > 0 ) {
@@ -299,7 +299,7 @@ CopyRequest parse(String... args) {
299299 if (args .length != 4 ) {
300300 throw new IllegalArgumentException ();
301301 }
302- return CopyRequest .of (Blob . of ( args [0 ], args [1 ]) , Blob .of (args [2 ], args [3 ]));
302+ return CopyRequest .of (args [0 ], args [1 ], Blob .of (args [2 ], args [3 ]));
303303 }
304304
305305 @ Override
0 commit comments