Top Description Constructors Methods
org.jabref.logic.util.io

public Class FileNameCleaner

extends Object
Class Inheritance

This class is based on http://stackoverflow.com/a/5626340/873282 extended with LEFT CURLY BRACE and RIGHT CURLY BRACE Replaces illegal characters in given file paths. Regarding the maximum length, see FileUtil#getValidFileName(String)

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

a clean filename
cleanDirectoryName
(String
the fileName to clean
badFileName
)

Replaces illegal characters in given directoryName by '_'.

public static String

Returns:

a clean filename
cleanFileName
(String
the fileName to clean
badFileName
)

Replaces illegal characters in given fileName by '_'

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FileNameCleanerback to summary
private FileNameCleaner()

Method Detail

cleanDirectoryNameback to summary
public static String cleanDirectoryName(String badFileName)

Replaces illegal characters in given directoryName by '_'. Directory name may contain directory separators, e.g. 'deep/in/a/tree'; these are left untouched.

Parameters
badFileName:String

the fileName to clean

Returns:String

a clean filename

cleanFileNameback to summary
public static String cleanFileName(String badFileName)

Replaces illegal characters in given fileName by '_'

Parameters
badFileName:String

the fileName to clean

Returns:String

a clean filename