private void renameInternal ( FileInfo srcInfo , URI dst ) throws IOException { if ( srcInfo . isDirectory ( ) ) { renameDirectoryInternal ( srcInfo , dst ) ; } else { URI src = srcInfo . getPath ( ) ; StorageResourceId srcResourceId = pathCodec . validatePathAndGetId ( src , true ) ; StorageResourceId dstResourceId = pathCodec . validatePathAndGetId ( dst , true ) ; gcs . copy ( srcResourceId . getBucketName ( ) , ImmutableList . of ( srcResourceId . getObjectName ( ) ) , dstResourceId . getBucketName ( ) , ImmutableList . of ( dstResourceId . getObjectName ( ) ) ) ; tryUpdateTimestampsForParentDirectories ( ImmutableList . of ( dst ) , ImmutableList . < URI > of ( ) ) ; // TODO(b/110833109): populate generation ID in StorageResourceId when getting info gcs . deleteObjects ( ImmutableList . of ( new StorageResourceId ( srcInfo . getItemInfo ( ) . getBucketName ( ) , srcInfo . getItemInfo ( ) . getObjectName ( ) , srcInfo . getItemInfo ( ) . getContentGeneration ( ) ) ) ) ; // Any path that was deleted, we should update the parent except for parents we also deleted tryUpdateTimestampsForParentDirectories ( ImmutableList . of ( src ) , ImmutableList . < URI > of ( ) ) ; } }
Renames the given path without checking any parameters .