code formatting
Some checks failed
Java CI / build (push) Failing after 3s
Java CI / javadoc-latest (push) Failing after 6s
Java CI / build-java7 (push) Failing after 6s
Dockerhub / docker (push) Failing after 25s
Java with IzPack Snapshot Setup / setup (push) Failing after 14s
Sync Primary Repository to GitHub Mirror / sync (push) Successful in 40s
Daily Workflow / daily-job (push) Failing after 4s
Daily Workflow / javadoc-latest (push) Failing after 7s
Daily Workflow / build-java7 (push) Failing after 6s
Some checks failed
Java CI / build (push) Failing after 3s
Java CI / javadoc-latest (push) Failing after 6s
Java CI / build-java7 (push) Failing after 6s
Dockerhub / docker (push) Failing after 25s
Java with IzPack Snapshot Setup / setup (push) Failing after 14s
Sync Primary Repository to GitHub Mirror / sync (push) Successful in 40s
Daily Workflow / daily-job (push) Failing after 4s
Daily Workflow / javadoc-latest (push) Failing after 7s
Daily Workflow / build-java7 (push) Failing after 6s
This commit is contained in:
@ -387,34 +387,30 @@ public class EepGet {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/* Blacklist borrowed from snark */
|
||||
|
||||
private static final char[] ILLEGAL = new char[] {
|
||||
/** Blacklist borrowed from snark */
|
||||
private static final char[] ILLEGAL = new char[] {
|
||||
'<', '>', ':', '"', '/', '\\', '|', '?', '*',
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
0x7f };
|
||||
|
||||
/**
|
||||
* Removes 'suspicious' characters from the given file name.
|
||||
* http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Removes 'suspicious' characters from the given file name.
|
||||
* http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
|
||||
*/
|
||||
private static String sanitize(String name) {
|
||||
if (name.equals(".") || name.equals(" "))
|
||||
return "_";
|
||||
String rv = name;
|
||||
if (rv.startsWith("."))
|
||||
rv = '_' + rv.substring(1);
|
||||
if (rv.endsWith(".") || rv.endsWith(" "))
|
||||
rv = rv.substring(0, rv.length() - 1) + '_';
|
||||
for (int i = 0; i < ILLEGAL.length; i++) {
|
||||
if (rv.indexOf(ILLEGAL[i]) >= 0)
|
||||
rv = rv.replace(ILLEGAL[i], '_');
|
||||
}
|
||||
return rv;
|
||||
if (name.equals(".") || name.equals(" "))
|
||||
return "_";
|
||||
String rv = name;
|
||||
if (rv.startsWith("."))
|
||||
rv = '_' + rv.substring(1);
|
||||
if (rv.endsWith(".") || rv.endsWith(" "))
|
||||
rv = rv.substring(0, rv.length() - 1) + '_';
|
||||
for (int i = 0; i < ILLEGAL.length; i++) {
|
||||
if (rv.indexOf(ILLEGAL[i]) >= 0)
|
||||
rv = rv.replace(ILLEGAL[i], '_');
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
private static void usage() {
|
||||
|
Reference in New Issue
Block a user