MCPcopy Index your code
hub / github.com/benfry/processing4 / smellsLikeSketchFolder

Method smellsLikeSketchFolder

app/src/processing/app/Base.java:1297–1311  ·  view source on GitHub ↗

Return true if it's an obvious sketch folder: only .pde files, and maybe a data folder. Dot files (.DS_Store, ._blah) are ignored.

(File folder)

Source from the content-addressed store, hash-verified

1295 * and maybe a data folder. Dot files (.DS_Store, ._blah) are ignored.
1296 */
1297 private boolean smellsLikeSketchFolder(File folder) {
1298 File[] files = folder.listFiles();
1299 if (files == null) { // unreadable, assume badness
1300 return false;
1301 }
1302 for (File file : files) {
1303 String name = file.getName();
1304 if (!(name.startsWith(".") ||
1305 name.toLowerCase().endsWith(".pde")) ||
1306 (file.isDirectory() && name.equals("data"))) {
1307 return false;
1308 }
1309 }
1310 return true;
1311 }
1312
1313
1314 private File moveLikeSketchFolder(File pdeFile, String baseName) throws IOException {

Callers 1

handleOpenMethod · 0.95

Calls 3

listFilesMethod · 0.45
getNameMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected