Merge branch 'master' of ssh://git@gitorious.org/yacy/rc1.git

pull/1/head
Michael Peter Christen 11 years ago
commit 0f0b60404b

@ -403,6 +403,7 @@ public final class FileUtils {
private final static Pattern escaped_backslash = Pattern.compile(Pattern.quote("\\"), Pattern.LITERAL); private final static Pattern escaped_backslash = Pattern.compile(Pattern.quote("\\"), Pattern.LITERAL);
public static void saveMap(final File file, final Map<String, String> props, final String comment) { public static void saveMap(final File file, final Map<String, String> props, final String comment) {
boolean err = false;
PrintWriter pw = null; PrintWriter pw = null;
final File tf = new File(file.toString() + "." + (System.currentTimeMillis() % 1000)); final File tf = new File(file.toString() + "." + (System.currentTimeMillis() % 1000));
try { try {
@ -428,15 +429,17 @@ public final class FileUtils {
pw.println("# EOF"); pw.println("# EOF");
} catch (final FileNotFoundException e ) { } catch (final FileNotFoundException e ) {
ConcurrentLog.warn("FileUtils", e.getMessage(), e); ConcurrentLog.warn("FileUtils", e.getMessage(), e);
err = true;
} catch (final UnsupportedEncodingException e ) { } catch (final UnsupportedEncodingException e ) {
ConcurrentLog.warn("FileUtils", e.getMessage(), e); ConcurrentLog.warn("FileUtils", e.getMessage(), e);
err = true;
} finally { } finally {
if ( pw != null ) { if ( pw != null ) {
pw.close(); pw.close();
} }
pw = null; pw = null;
} }
try { if (!err) try {
forceMove(tf, file); forceMove(tf, file);
} catch (final IOException e ) { } catch (final IOException e ) {
// ignore // ignore

Loading…
Cancel
Save