From 72e8eec3d58b7c31edf71859831c0e7324a24cee Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 17 Jan 2020 18:50:13 +0100 Subject: [PATCH] coding conventions & unused parts removed --- src/cryogen_core/classpath_able_io.clj | 8 +++----- test/cryogen_core/classpath_able_io_test.clj | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cryogen_core/classpath_able_io.clj b/src/cryogen_core/classpath_able_io.clj index 04091ab..a32b5ba 100644 --- a/src/cryogen_core/classpath_able_io.clj +++ b/src/cryogen_core/classpath_able_io.clj @@ -19,8 +19,6 @@ (def Prefix s/Str) -(def FilesystemUri s/Any) ; java.net.URI - (def ResourceUri s/Any) ; java.net.URI (def ShortPath s/Str) @@ -77,9 +75,9 @@ [resource :- Resource] (= :file (:resource-type resource))) -(s/defn init-FileSystem +(s/defn init-file-system [resource-uri :- ResourceUri] - (let [path-to-filesystem (st/join (pop (st/split (.toString resource-uri) #"!")))] + (let [path-to-filesystem (pop (st/split (.toString resource-uri) #"!"))] (try (FileSystems/newFileSystem (java.net.URI. path-to-filesystem) @@ -93,7 +91,7 @@ (try (let [resource-uri (.toURI (io/resource resource-path))] ; check if contains jar: (when (st/starts-with? (.toString resource-uri) "jar:") - (init-FileSystem resource-uri)) + (init-file-system resource-uri)) (when (Files/exists (Paths/get resource-uri) NoLinkOption) (Paths/get resource-uri))) (catch Exception e diff --git a/test/cryogen_core/classpath_able_io_test.clj b/test/cryogen_core/classpath_able_io_test.clj index eecefc4..0980286 100644 --- a/test/cryogen_core/classpath_able_io_test.clj +++ b/test/cryogen_core/classpath_able_io_test.clj @@ -23,6 +23,8 @@ (def NoLinkOption (into-array [LinkOption/NOFOLLOW_LINKS])) +(sut/init-file-system (io/resource "dummy")) + ; TODO: Fix this test! (deftest test-file-from-cp (is