Use index of last dot in filename to find out the type of a file
This commit is contained in:
parent
a5b2945065
commit
003173f895
1 changed files with 4 additions and 4 deletions
|
@ -224,11 +224,11 @@ public final class TypeManager {
|
||||||
* Update a prototype to the files in the prototype directory.
|
* Update a prototype to the files in the prototype directory.
|
||||||
*/
|
*/
|
||||||
public void updatePrototype (Prototype proto) {
|
public void updatePrototype (Prototype proto) {
|
||||||
|
|
||||||
if (proto == null)
|
if (proto == null)
|
||||||
return;
|
return;
|
||||||
// if prototype has been checked in the last 1.5 seconds, return
|
// System.err.println ("UPDATE PROTO: "+app.getName()+"/"+proto.getName());
|
||||||
// if (System.currentTimeMillis() - proto.getLastCheck() < 2500)
|
// if prototype has been checked in the last second, return
|
||||||
|
// if (System.currentTimeMillis() - proto.getLastCheck() < 1000)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
synchronized (proto) {
|
synchronized (proto) {
|
||||||
|
@ -281,7 +281,7 @@ public final class TypeManager {
|
||||||
String[] list = dir.list ();
|
String[] list = dir.list ();
|
||||||
for (int i=0; i<list.length; i++) {
|
for (int i=0; i<list.length; i++) {
|
||||||
String fn = list[i];
|
String fn = list[i];
|
||||||
int dot = fn.indexOf (".");
|
int dot = fn.lastIndexOf (".");
|
||||||
|
|
||||||
if (dot < 0)
|
if (dot < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue