
com.groupbyinc.flux.common.blobstore.fs.FsBlobContainer.class Maven / Gradle / Ivy
???? 48 7com/groupbyinc/flux/common/blobstore/fs/FsBlobContainer Bcom/groupbyinc/flux/common/blobstore/support/AbstractBlobContainer FsBlobContainer.java 9com/groupbyinc/flux/common/blobstore/fs/FsBlobContainer$1 TEMP_FILE_PREFIX Ljava/lang/String; pending-
blobStore 5Lcom/groupbyinc/flux/common/blobstore/fs/FsBlobStore; path Ljava/nio/file/Path; {(Lcom/groupbyinc/flux/common/blobstore/fs/FsBlobStore;Lcom/groupbyinc/flux/common/blobstore/BlobPath;Ljava/nio/file/Path;)V 2(Lcom/groupbyinc/flux/common/blobstore/BlobPath;)V
this 9Lcom/groupbyinc/flux/common/blobstore/fs/FsBlobContainer; blobPath /Lcom/groupbyinc/flux/common/blobstore/BlobPath; listBlobs ()Ljava/util/Map; java/io/IOException listBlobsByPrefix #(Ljava/lang/String;)Ljava/util/Map; ! "
# java/lang/Throwable % java/util/HashMap ' ()V )
( * ,
java/util/Map . java/lang/String 0 java/lang/StringBuilder 2
3 * append -(Ljava/lang/String;)Ljava/lang/StringBuilder; 5 6
3 7 * 9 toString ()Ljava/lang/String; ; <
3 = java/nio/file/Files ? newDirectoryStream G(Ljava/nio/file/Path;Ljava/lang/String;)Ljava/nio/file/DirectoryStream; A B
@ C java/nio/file/DirectoryStream E iterator ()Ljava/util/Iterator; G H F I java/util/Iterator K hasNext ()Z M N L O next ()Ljava/lang/Object; Q R L S java/nio/file/Path U +java/nio/file/attribute/BasicFileAttributes W java/nio/file/LinkOption Y readAttributes o(Ljava/nio/file/Path;Ljava/lang/Class;[Ljava/nio/file/LinkOption;)Ljava/nio/file/attribute/BasicFileAttributes; [ \
@ ]
isRegularFile _ N X ` getFileName ()Ljava/nio/file/Path; b c V d V = >com/groupbyinc/flux/common/blobstore/support/PlainBlobMetaData g size ()J i j X k (Ljava/lang/String;J)V m
h n put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; p q / r $closeResource 1(Ljava/lang/Throwable;Ljava/lang/AutoCloseable;)V t u
v java/util/Collections x unmodifiableMap (Ljava/util/Map;)Ljava/util/Map; z {
y | attrs -Ljava/nio/file/attribute/BasicFileAttributes; file stream 5Ljava/nio/file/DirectoryStream; Ljava/nio/file/DirectoryStream; blobNamePrefix builder VLjava/util/Map; Ljava/util/Map;
deleteBlob (Ljava/lang/String;)V resolve ((Ljava/lang/String;)Ljava/nio/file/Path; ? ? V ? isDirectory 2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z ? ?
@ ? <(Lcom/groupbyinc/flux/common/blobstore/fs/FsBlobContainer;)V ?
? walkFileTree E(Ljava/nio/file/Path;Ljava/nio/file/FileVisitor;)Ljava/nio/file/Path; ? ?
@ ? delete (Ljava/nio/file/Path;)V ? ?
@ ? blobName
blobExists (Ljava/lang/String;)Z exists ? ?
@ ? readBlob )(Ljava/lang/String;)Ljava/io/InputStream; java/io/FileNotFoundException ? java/io/BufferedInputStream ? java/nio/file/OpenOption ? newInputStream F(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream; ? ?
@ ? 3com/groupbyinc/flux/common/blobstore/fs/FsBlobStore ? bufferSizeInBytes ()I ? ?
? ? (Ljava/io/InputStream;I)V ?
? ? !java/nio/file/NoSuchFileException ? [ ? ] blob not found ? ?
? ? fnfe Ljava/io/FileNotFoundException; name resolvedPath writeBlob ,(Ljava/lang/String;Ljava/io/InputStream;JZ)V deleteBlobIgnoringIfNotExists ? ?
? java/nio/file/StandardOpenOption ?
CREATE_NEW "Ljava/nio/file/StandardOpenOption; ? ? ? ? newOutputStream G(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream; ? ?
@ ? ,com/groupbyinc/flux/core/internal/io/Streams ? copy .(Ljava/io/InputStream;Ljava/io/OutputStream;)J ? ?
? ? java/io/InputStream ? java/io/OutputStream ? ,com/groupbyinc/flux/core/internal/io/IOUtils ? fsync (Ljava/nio/file/Path;Z)V ? ?
? ? outputStream Ljava/io/OutputStream; inputStream Ljava/io/InputStream; blobSize J failIfAlreadyExists Z writeBlobAtomic tempBlobName &(Ljava/lang/String;)Ljava/lang/String; ? ?
? moveBlobAtomic ((Ljava/lang/String;Ljava/lang/String;Z)V ? ?
?
addSuppressed (Ljava/lang/Throwable;)V ? ?
? e Ljava/io/IOException; ex tempBlob tempBlobPath (java/nio/file/FileAlreadyExistsException ? blob [ ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; 5
3 "] already exists, cannot overwrite
? ? java/nio/file/CopyOption java/nio/file/StandardCopyOption ATOMIC_MOVE "Ljava/nio/file/StandardCopyOption;
move Y(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/CopyOption;)Ljava/nio/file/Path;
@ sourceBlobName targetBlobName sourceBlobPath targetBlobPath - com/groupbyinc/flux/common/UUIDs randomBase64UUID <
isTempBlobName
startsWith ?
1 java/lang/AutoCloseable" close$ )#%
&