@@ -83,8 +83,7 @@ public static UserLibrary create(File libFolder) throws IOException {
83
83
// "arch" folder no longer supported
84
84
File archFolder = new File (libFolder , "arch" );
85
85
if (archFolder .isDirectory ())
86
- throw new IOException ("'arch' folder is no longer supported! See "
87
- + "http://goo.gl/gfFJzU for more information" );
86
+ throw new IOException ("'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information" );
88
87
89
88
// Check mandatory properties
90
89
for (String p : MANDATORY_PROPERTIES )
@@ -101,20 +100,22 @@ public static UserLibrary create(File libFolder) throws IOException {
101
100
102
101
File utilFolder = new File (libFolder , "utility" );
103
102
if (utilFolder .exists () && utilFolder .isDirectory ()) {
104
- throw new IOException (
105
- "Library can't use both 'src' and 'utility' folders." );
103
+ throw new IOException ("Library can't use both 'src' and 'utility' folders." );
106
104
}
107
105
} else {
108
106
// Layout with source code on library's root and "utility" folders
109
107
layout = LibraryLayout .FLAT ;
110
108
}
111
109
112
110
// Warn if root folder contains development leftovers
113
- for (File file : libFolder .listFiles ()) {
114
- if (file .isDirectory ()) {
115
- if (FileUtils .isSCCSOrHiddenFile (file )) {
111
+ File [] files = libFolder .listFiles ();
112
+ if (files == null ) {
113
+ throw new IOException ("Unable to list files of library in " + libFolder );
114
+ }
115
+ for (File file : files ) {
116
+ if (file .isDirectory () && FileUtils .isSCCSOrHiddenFile (file )) {
117
+ if (!FileUtils .isSCCSFolder (file ) && FileUtils .isHiddenFile (file )) {
116
118
System .out .println ("WARNING: Spurious " + file .getName () + " folder in '" + properties .get ("name" ) + "' library" );
117
- continue ;
118
119
}
119
120
}
120
121
}
@@ -131,8 +132,7 @@ public static UserLibrary create(File libFolder) throws IOException {
131
132
if (category == null )
132
133
category = "Uncategorized" ;
133
134
if (!CATEGORIES .contains (category )) {
134
- System .out .println ("WARNING: Category '" + category + "' in library " +
135
- properties .get ("name" ) + " is not valid. Setting to 'Uncategorized'" );
135
+ System .out .println ("WARNING: Category '" + category + "' in library " + properties .get ("name" ) + " is not valid. Setting to 'Uncategorized'" );
136
136
category = "Uncategorized" ;
137
137
}
138
138
0 commit comments