 	                                      (last s1)]))))
 
   
-  (defn close-and-roll [{:keys [file ^OutputStream out] :as file-data} i]
+  (defn close-and-roll [{:keys [^File file ^OutputStream out] :as file-data} i]
     "Close the output stream and rename the file by removing the last _[number] suffix"
     (try
       (do 
         (.flush out)
         (.close out))
       (catch Exception e (error e e)))
-    (let [file2 (File. (.getParent file)
-                       (add-file-name-index
+    (let [file2 (File. ^File (.getParent file)
+                       ^String (add-file-name-index
                          (clj-str/join "" (interpose "_" (-> (.getName file) (clj-str/split #"_") drop-last)))
                          i))]
       (if (.exists file2)

	               (do
                   (try
		                  (doseq [f roll-callbacks]
		                    (info "before roll") (f v) (info "after roll"))
                    
		                (catch Exception e (.printStackTrace e)))
                  (recur))))))
	        
	       (assoc conn :fix-delay-ch (fixdelay (:check-freq conn)

 
  (defn ^File create-file [base-dir codec file-key]
    "Create and return a File object with the name based on the file key codec and base dir"
       (File. (clojure.java.io/file base-dir)
              (str file-key 
                            (codec-extension codec)
                            "_" (System/nanoTime))))
      
