Skip to content

Don't forbid unknown files in a library #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions app/src/processing/app/packages/Library.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ public class Library {
.asList(new String[] { "architectures", "author", "core-dependencies",
"dependencies", "email", "name", "paragraph", "sentence", "url",
"version" });
private static final List<String> OPTIONAL_FOLDERS = Arrays
.asList(new String[] { "arch", "examples", "extras", "src" });
private static final List<String> OPTIONAL_FILES = Arrays
.asList(new String[] { "keywords.txt", "library.properties" });


/**
* Scans inside a folder and create a Library object out of it. Automatically
Expand Down Expand Up @@ -74,21 +69,6 @@ private static Library createLibrary(File libFolder) throws IOException {
if (!srcFolder.exists() || !srcFolder.isDirectory())
throw new IOException("Missing 'src' folder");

// 3. check if root folder contains prohibited stuff
for (File file : libFolder.listFiles()) {
if (file.isDirectory()) {
if (FileUtils.isSCCSOrHiddenFile(file)) {
System.out.println("WARNING: Ignoring spurious " + file.getName() + " folder in '" + properties.get("name") + "' library");
continue;
}
if (!OPTIONAL_FOLDERS.contains(file.getName()))
throw new IOException("Invalid folder '" + file.getName() + "'.");
} else {
if (!OPTIONAL_FILES.contains(file.getName()))
throw new IOException("Invalid file '" + file.getName() + "'.");
}
}

// Extract metadata info
List<String> archs = new ArrayList<String>();
for (String arch : properties.get("architectures").split(","))
Expand Down