@@ -83,8 +83,7 @@ public static UserLibrary create(File libFolder) throws IOException {
8383 // "arch" folder no longer supported
8484 File archFolder = new File (libFolder , "arch" );
8585 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" );
8887
8988 // Check mandatory properties
9089 for (String p : MANDATORY_PROPERTIES )
@@ -101,20 +100,22 @@ public static UserLibrary create(File libFolder) throws IOException {
101100
102101 File utilFolder = new File (libFolder , "utility" );
103102 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." );
106104 }
107105 } else {
108106 // Layout with source code on library's root and "utility" folders
109107 layout = LibraryLayout .FLAT ;
110108 }
111109
112110 // 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 )) {
116118 System .out .println ("WARNING: Spurious " + file .getName () + " folder in '" + properties .get ("name" ) + "' library" );
117- continue ;
118119 }
119120 }
120121 }
@@ -131,8 +132,7 @@ public static UserLibrary create(File libFolder) throws IOException {
131132 if (category == null )
132133 category = "Uncategorized" ;
133134 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'" );
136136 category = "Uncategorized" ;
137137 }
138138
0 commit comments