com.jayway.maven.plugins.android.common.FileNameHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of android-maven-plugin Show documentation
Show all versions of android-maven-plugin Show documentation
Maven Plugin for Android Development
package com.jayway.maven.plugins.android.common;
/**
* FileNameHelper can make a valid filename.
*
* @author alexv
*/
public class FileNameHelper
{
// { '/', '\n', '\r', '\t', '\0', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':' };
private static final String ILLEGAL_CHARACTERS_REGEX = "[/\\n\\r\\t\\\0\\f`\\?\\*\\\\<>\\|\":]";
private static final String SEPERATOR = "_";
public static String fixFileName( String fileName )
{
return fileName.replaceAll( ILLEGAL_CHARACTERS_REGEX, SEPERATOR );
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy