124124FolderStore (label:: Symbol , folder:: String ) = FolderStore {Vector{UInt8}} (label, folder)
125125
126126function FolderStore (foldername:: String ; label:: Symbol = :default , createfolder = true )
127- storepath = joinpath (foldername, string (label))
127+ storepath = expanduser ( joinpath (foldername, string (label) ))
128128 if createfolder && ! isdir (storepath)
129129 @info " Folder '$storepath ' doesn't exist - creating."
130130 # create new folder
@@ -134,11 +134,11 @@ function FolderStore(foldername::String; label::Symbol = :default, createfolder
134134end
135135
136136function blobfilename (store:: FolderStore , blobid:: UUID )
137- return joinpath (store. folder, string (store. label), string (blobid))
137+ return expanduser ( joinpath (store. folder, string (store. label), string (blobid) ))
138138end
139139
140140function getBlob (store:: FolderStore{T} , blobid:: UUID ) where {T}
141- blobfilename = joinpath (store. folder, string (store. label), string (blobid))
141+ blobfilename = expanduser ( joinpath (store. folder, string (store. label), string (blobid) ))
142142 tombstonefile = blobfilename * " .deleted"
143143 if isfile (tombstonefile)
144144 throw (IdNotFoundError (" Blob (deleted)" , blobid))
@@ -152,7 +152,7 @@ function getBlob(store::FolderStore{T}, blobid::UUID) where {T}
152152end
153153
154154function addBlob! (store:: FolderStore{T} , blobid:: UUID , data:: T ) where {T}
155- blobfilename = joinpath (store. folder, string (store. label), string (blobid))
155+ blobfilename = expanduser ( joinpath (store. folder, string (store. label), string (blobid) ))
156156 if isfile (blobfilename)
157157 throw (IdExistsError (" Blob" , blobid))
158158 else
165165
166166function deleteBlob! (store:: FolderStore{T} , blobid:: UUID ) where {T}
167167 # Tombstone pattern: instead of deleting the file, create a tombstone marker file
168- blobfilename = joinpath (store. folder, string (store. label), string (blobid))
168+ blobfilename = expanduser ( joinpath (store. folder, string (store. label), string (blobid) ))
169169 tombstonefile = blobfilename * " .deleted"
170170 if isfile (blobfilename)
171171 # Remove the actual blob file
@@ -185,14 +185,14 @@ function deleteBlob!(store::FolderStore{T}, blobid::UUID) where {T}
185185end
186186
187187function hasBlob (store:: FolderStore , blobid:: UUID )
188- blobfilename = joinpath (store. folder, string (store. label), string (blobid))
188+ blobfilename = expanduser ( joinpath (store. folder, string (store. label), string (blobid) ))
189189 return isfile (blobfilename)
190190end
191191
192192hasBlob (store:: FolderStore , entry:: Blobentry ) = hasBlob (store, entry. blobid)
193193
194194function listBlobs (store:: FolderStore )
195- folder = joinpath (store. folder, string (store. label))
195+ folder = expanduser ( joinpath (store. folder, string (store. label) ))
196196 # Parse folder to only include UUIDs automatically excluding tombstone files this way.
197197 blobids = UUID[]
198198 for filename in readdir (folder)
@@ -249,11 +249,11 @@ listBlobs(store::InMemoryBlobstore) = collect(keys(store.blobs))
249249# #==============================================================================
250250# # LinkStore Link blobid to a existing local folder
251251# #==============================================================================
252-
253- struct LinkStore <: AbstractBlobstore{String}
252+ # TODO consider using a deterministic blobid (uuid5) with ns stored in the csv?
253+ @tags struct LinkStore <: AbstractBlobstore{String}
254254 label:: Symbol
255255 csvfile:: String
256- cache:: Dict{UUID, String}
256+ cache:: Dict{UUID, String} & (json = (ignore = true ,),)
257257
258258 function LinkStore (label, csvfile)
259259 if ! isfile (csvfile)
0 commit comments