From 11b4034a9e3d78ba3060d2ebba2216512d0ba491 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 7 Feb 2008 23:16:23 +0000 Subject: [PATCH] little bit of documentation --- source/net/sourceforge/filebot/ui/FileFormat.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/net/sourceforge/filebot/ui/FileFormat.java b/source/net/sourceforge/filebot/ui/FileFormat.java index 62510603..23fe78da 100644 --- a/source/net/sourceforge/filebot/ui/FileFormat.java +++ b/source/net/sourceforge/filebot/ui/FileFormat.java @@ -90,11 +90,13 @@ public class FileFormat { public static String getName(File file) { - if (!file.getName().isEmpty()) { - return file.getName(); - } else { - return file.toString(); - } + String name = file.getName(); + + if (!name.isEmpty()) + return name; + + // file might be a drive (only has a path, but no name) + return file.toString(); } }