diff --git a/backend/src/uxbox/cli/collimp.clj b/backend/src/uxbox/cli/collimp.clj index 4b7ebffb9..8eceacb86 100644 --- a/backend/src/uxbox/cli/collimp.clj +++ b/backend/src/uxbox/cli/collimp.clj @@ -13,7 +13,7 @@ [cuerdas.core :as str] [suricatta.core :as sc] [storages.core :as st] - [storages.util :as fs] + [storages.fs :as fs] [uxbox.config] [uxbox.db :as db] [uxbox.migrations] diff --git a/backend/src/uxbox/frontend/images.clj b/backend/src/uxbox/frontend/images.clj index 95708d7e9..a2001faa0 100644 --- a/backend/src/uxbox/frontend/images.clj +++ b/backend/src/uxbox/frontend/images.clj @@ -9,7 +9,7 @@ [promesa.core :as p] [catacumba.http :as http] [storages.core :as st] - [storages.util :as path] + [storages.fs :as fs] [uxbox.media :as media] [uxbox.images :as images] [uxbox.util.spec :as us] @@ -116,7 +116,7 @@ (let [{:keys [file id width height mimetype collection]} (us/conform ::create-image data) id (or id (uuid/random)) - filename (path/base-name file) + filename (fs/base-name file) storage media/images-storage] (letfn [(persist-image-entry [path] (sv/novelty {:id id diff --git a/backend/src/uxbox/frontend/users.clj b/backend/src/uxbox/frontend/users.clj index 31467d1a0..5e8ffa401 100644 --- a/backend/src/uxbox/frontend/users.clj +++ b/backend/src/uxbox/frontend/users.clj @@ -9,7 +9,7 @@ [promesa.core :as p] [catacumba.http :as http] [storages.core :as st] - [storages.util :as path] + [storages.fs :as fs] [uxbox.media :as media] [uxbox.images :as images] [uxbox.util.spec :as us] @@ -80,7 +80,7 @@ (defn update-photo [{user :identity data :data}] (letfn [(store-photo [file] - (let [filename (path/base-name file) + (let [filename (fs/base-name file) storage media/images-storage] (st/save storage filename file))) (assign-photo [path] diff --git a/backend/src/uxbox/images.clj b/backend/src/uxbox/images.clj index af9faad68..9faf467b4 100644 --- a/backend/src/uxbox/images.clj +++ b/backend/src/uxbox/images.clj @@ -6,9 +6,9 @@ (ns uxbox.images "Image postprocessing." - (:require [storages.core :as st] - [storages.util :as path] - [clojure.spec :as s] + (:require [clojure.spec :as s] + [storages.core :as st] + [storages.fs :as fs] [uxbox.util.spec :as us] [uxbox.media :as media] [uxbox.util.images :as images] @@ -18,12 +18,12 @@ (defn make-thumbnail [path {:keys [size format quality] :as cfg}] - (let [parent (path/parent path) - [filename ext] (path/split-ext path) + (let [parent (fs/parent path) + [filename ext] (fs/split-ext path) suffix-parts [(nth size 0) (nth size 1) quality format] final-name (apply str filename "-" (interpose "." suffix-parts)) - final-path (path/path parent final-name) + final-path (fs/path parent final-name) images-storage media/images-storage thumbs-storage media/thumbnails-storage] diff --git a/backend/src/uxbox/media.clj b/backend/src/uxbox/media.clj index 1a88fac27..37a1dbc59 100644 --- a/backend/src/uxbox/media.clj +++ b/backend/src/uxbox/media.clj @@ -10,19 +10,19 @@ [clojure.java.io :as io] [cuerdas.core :as str] [storages.core :as st] - [storages.fs.local :refer (filesystem)] - [storages.fs.misc :refer (hashed scoped)] + [storages.backend.local :refer (localfs)] + [storages.backend.misc :refer (hashed scoped)] [uxbox.config :refer (config)])) ;; --- State (defstate static-storage :start (let [{:keys [basedir baseuri]} (:static config)] - (filesystem {:basedir basedir :baseuri baseuri}))) + (localfs {:basedir basedir :baseuri baseuri}))) (defstate media-storage :start (let [{:keys [basedir baseuri]} (:media config)] - (filesystem {:basedir basedir :baseuri baseuri}))) + (localfs {:basedir basedir :baseuri baseuri}))) (defstate images-storage :start (-> media-storage diff --git a/backend/src/uxbox/portation.clj b/backend/src/uxbox/portation.clj index 1cef68743..85d447e8a 100644 --- a/backend/src/uxbox/portation.clj +++ b/backend/src/uxbox/portation.clj @@ -9,12 +9,11 @@ (:refer-clojure :exclude [with-open]) (:require [clojure.java.io :as io] [suricatta.core :as sc] - [storages.util :as path] + [storages.fs :as fs] [uxbox.db :as db] [uxbox.sql :as sql] [uxbox.util.uuid :as uuid] [uxbox.util.closeable :refer (with-open)] - [uxbox.util.tempfile :as tmpfile] [uxbox.util.transit :as t] [uxbox.util.snappy :as snappy])) @@ -55,7 +54,7 @@ "Given an id, returns a path to a temporal file with the exported bundle of the specified project." [id] - (let [path (tmpfile/create)] + (let [path (fs/create-tempfile)] (write-data path id) path)) @@ -105,7 +104,7 @@ (defn import! "Given a path to the previously exported bundle, try to import it." [path] - (with-open [istream (io/input-stream (path/path path)) + (with-open [istream (io/input-stream (fs/path path)) zstream (snappy/input-stream istream) conn (db/connection)] (let [reader (t/reader zstream {:type :msgpack})] diff --git a/backend/src/uxbox/services/images.clj b/backend/src/uxbox/services/images.clj index 1e24accad..6900870ad 100644 --- a/backend/src/uxbox/services/images.clj +++ b/backend/src/uxbox/services/images.clj @@ -9,9 +9,8 @@ (:require [clojure.spec :as s] [promesa.core :as p] [suricatta.core :as sc] - [buddy.core.codecs :as codecs] [storages.core :as st] - [storages.util :as path] + [storages.fs :as fs] [uxbox.config :as ucfg] [uxbox.util.spec :as us] [uxbox.sql :as sql] @@ -185,7 +184,7 @@ (ex/raise :type :validation :code ::image-does-not-exists)) (let [path @(st/lookup storage (:path image)) - filename (path/base-name path) + filename (fs/base-name path) path @(st/save storage filename path) image (assoc image :path (str path)