[jenkinscat-docs] master: Added function to move and rename file(s). Added new configuration option. (dbaad80)
immanetize at fedoraproject.org
immanetize at fedoraproject.org
Fri Feb 6 07:41:27 UTC 2015
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit dbaad80c75a3ff0dba303b6f5242c9fb021766e5
Author: Pavel Tisnovsky <ptisnovs at redhat.com>
Date: Wed Feb 4 11:19:21 2015 +0100
Added function to move and rename file(s). Added new configuration option.
>---------------------------------------------------------------
ChangeLog | 7 +++++++
src/jenkinscat/config.clj | 6 +++++-
src/jenkinscat/fileutils.clj | 9 ++++++++-
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0ac0db8..58453dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-04 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/jenkinscat/config.clj:
+ Added new configuration option.
+ * src/jenkinscat/fileutils.clj:
+ Added function to move and rename file(s).
+
2015-02-03 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/jenkinscat/books.clj:
diff --git a/src/jenkinscat/config.clj b/src/jenkinscat/config.clj
index eced421..cf826c7 100644
--- a/src/jenkinscat/config.clj
+++ b/src/jenkinscat/config.clj
@@ -1,7 +1,7 @@
;;;
;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
;;;
-;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; Copyright (c) 2014, 2015 Pavel Tisnovsky, Red Hat
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
@@ -59,3 +59,7 @@
"Whether devel mode should be on."
true)
+(def fetcher-sleep-amount
+ "Amount of sleep for fetcher. The sleep amount is specified in minutes."
+ 2)
+
diff --git a/src/jenkinscat/fileutils.clj b/src/jenkinscat/fileutils.clj
index f3abef7..52ab7ad 100644
--- a/src/jenkinscat/fileutils.clj
+++ b/src/jenkinscat/fileutils.clj
@@ -1,7 +1,7 @@
;;;
;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
;;;
-;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; Copyright (c) 2014, 2015 Pavel Tisnovsky, Red Hat
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
@@ -84,3 +84,10 @@
temp-dir (new java.io.File basedir-name base-name)]
(.getAbsolutePath temp-dir)))
+(defn mv-file
+ "Move or rename one file. On the same filesystem the rename should be atomic."
+ [filename1 filename2]
+ (let [file1 (new java.io.File filename1)
+ file2 (new java.io.File filename2)]
+ (.renameTo file1 file2)))
+
More information about the docs-commits
mailing list