3939import java .nio .file .Files ;
4040import java .nio .file .Paths ;
4141import java .util .ArrayList ;
42- import java .util .Arrays ;
4342import java .util .LinkedList ;
4443import java .util .List ;
4544
@@ -59,15 +58,6 @@ public class UserLibrary extends ContributedLibrary {
5958 private List <String > declaredTypes ;
6059 private boolean onGoingDevelopment ;
6160
62- private static final List <String > MANDATORY_PROPERTIES = Arrays
63- .asList ("name" , "version" , "author" , "maintainer" ,
64- "sentence" , "paragraph" , "url" );
65-
66- private static final List <String > CATEGORIES = Arrays .asList (
67- "Display" , "Communication" , "Signal Input/Output" , "Sensors" ,
68- "Device Control" , "Timing" , "Data Storage" , "Data Processing" , "Other" ,
69- "Uncategorized" );
70-
7161 public static UserLibrary create (File libFolder ) throws IOException {
7262 // Parse metadata
7363 File propertiesFile = new File (libFolder , "library.properties" );
@@ -90,7 +80,7 @@ public static UserLibrary create(File libFolder) throws IOException {
9080 throw new IOException ("'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information" );
9181
9282 // Check mandatory properties
93- for (String p : MANDATORY_PROPERTIES )
83+ for (String p : Constants . LIBRARY_MANDATORY_PROPERTIES )
9484 if (!properties .containsKey (p ))
9585 throw new IOException ("Missing '" + p + "' from library" );
9686
@@ -135,7 +125,7 @@ public static UserLibrary create(File libFolder) throws IOException {
135125 String category = properties .get ("category" );
136126 if (category == null )
137127 category = "Uncategorized" ;
138- if (!CATEGORIES .contains (category )) {
128+ if (!Constants . LIBRARY_CATEGORIES .contains (category )) {
139129 System .out .println ("WARNING: Category '" + category + "' in library " + properties .get ("name" ) + " is not valid. Setting to 'Uncategorized'" );
140130 category = "Uncategorized" ;
141131 }
@@ -222,10 +212,6 @@ public String getLicense() {
222212 return license ;
223213 }
224214
225- public static List <String > getCategories () {
226- return CATEGORIES ;
227- }
228-
229215 @ Override
230216 public void setCategory (String category ) {
231217 this .category = category ;
0 commit comments