*/
package jalview.io;
+import jalview.util.MessageManager;
+
import java.io.File;
import java.net.URL;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import javax.swing.Icon;
public String getTypeDescription(File f)
{
String extension = getExtension(f);
+
String type = getDescriptionForExtension(extension);
+
if (extension != null)
{
if (extensions.containsKey(extension))
{
String extension = getExtension(f);
Icon icon = null;
+ String type = getDescriptionForExtension(extension);
+
+ if (type == null)
+ {
+ Iterator<String> it = extensions.keySet().iterator();
+ EXTENSION: while (it.hasNext())
+ {
+ String ext = it.next();
+
+ // quick negative test
+ if (!f.getName().contains(ext))
+ {
+ continue EXTENSION;
+ }
+
+ BackupFilenameParts bfp = BackupFilenameParts
+ .currentBackupFilenameParts(f.getName(), ext, true);
+ if (bfp.isBackupFile())
+ {
+ extension = ext;
+ type = getDescriptionForExtension(extension)
+ + MessageManager.getString("label.backup");
+ break;
+ }
+ }
+ }
- if (getDescriptionForExtension(extension) != null)
+ if (type != null)
{
icon = getImageIcon("/images/file.png");
}