From 351954de15f41aec4d98323b13155ef5c9f68664 Mon Sep 17 00:00:00 2001 From: Michael Keppler Date: Sat, 26 Apr 2014 11:22:52 +0200 Subject: fix broken JavaDoc --- main/src/cgeo/geocaching/utils/FileUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'main/src/cgeo/geocaching/utils/FileUtils.java') diff --git a/main/src/cgeo/geocaching/utils/FileUtils.java b/main/src/cgeo/geocaching/utils/FileUtils.java index de068fd..979820c 100644 --- a/main/src/cgeo/geocaching/utils/FileUtils.java +++ b/main/src/cgeo/geocaching/utils/FileUtils.java @@ -23,6 +23,8 @@ import java.util.List; */ public final class FileUtils { + private static final String FILE_PROTOCOL = "file://"; + private FileUtils() { // utility class } @@ -160,7 +162,7 @@ public final class FileUtils { * @return true if the URL scheme is file, false otherwise */ public static boolean isFileUrl(final String url) { - return StringUtils.startsWith(url, "file://"); + return StringUtils.startsWith(url, FILE_PROTOCOL); } /** @@ -170,15 +172,15 @@ public final class FileUtils { * @return an URL with the file scheme */ public static String fileToUrl(final File file) { - return "file://" + file.getAbsolutePath(); + return FILE_PROTOCOL + file.getAbsolutePath(); } /** - * Local file name when {@link #isLocalFile()} is true. - * + * Local file name when {@link #isFileUrl(String)} is true. + * * @return the local file */ public static File urlToFile(final String url) { - return new File(StringUtils.substring(url, 7)); + return new File(StringUtils.substring(url, FILE_PROTOCOL.length())); } } -- cgit v1.1