MCPcopy Index your code
hub / github.com/processing/processing / accept

Method accept

app/src/processing/app/Sketch.java:947–974  ·  view source on GitHub ↗
(File file)

Source from the content-addressed store, hash-verified

945
946 File[] copyItems = folder.listFiles(new FileFilter() {
947 public boolean accept(File file) {
948 String name = file.getName();
949 // just in case the OS likes to return these as if they're legit
950 if (name.equals(".") || name.equals("..")) {
951 return false;
952 }
953 // list of files/folders to be ignored during "save as"
954 String[] ignorable = mode.getIgnorable();
955 if (ignorable != null) {
956 for (String ignore : ignorable) {
957 if (name.equals(ignore)) {
958 return false;
959 }
960 }
961 }
962 // ignore the extensions for code, since that'll be copied below
963 for (String ext : mode.getExtensions()) {
964 if (name.endsWith(ext)) {
965 return false;
966 }
967 }
968 // don't do screen captures, since there might be thousands. kind of
969 // a hack, but seems harmless. hm, where have i heard that before...
970 if (name.startsWith("screen-")) {
971 return false;
972 }
973 return true;
974 }
975 });
976
977 startSaveAsThread(oldName, newName, newFolder, copyItems);

Callers

nothing calls this directly

Calls 5

startsWithMethod · 0.80
getNameMethod · 0.45
equalsMethod · 0.45
getIgnorableMethod · 0.45
getExtensionsMethod · 0.45

Tested by

no test coverage detected