Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Mar 13, 2024
1 parent 3e9269d commit b0b8d64
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
25 changes: 1 addition & 24 deletions core/src/main/java/lucee/commons/io/watch/DirectoryWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import lucee.print;

public class DirectoryWatcher {

private File root;
Expand All @@ -31,8 +29,6 @@ private void execute() {
for (File d: directories.keySet()) {
// directory change
if (lastModified < d.lastModified()) {
print.e("directory changed!");
print.e(d);
recollect(directories, files, d);
lastModified = d.lastModified();
cleanup = true;
Expand All @@ -42,8 +38,6 @@ private void execute() {
// List<File> mods = new ArrayList<File>();
for (File d: files.keySet()) {
if (!d.exists()) {
print.e("file removed!");
print.e(d);
files.remove(d);
// mods.add(d);
}
Expand All @@ -54,14 +48,10 @@ private void execute() {
}
for (File d: files.keySet()) {
if (lastModified < d.lastModified()) {
print.e("file changed!");
print.e(d);
files.put(d, new FileInfo(d));
lastModified = d.lastModified();
}
}

print.e(directories.size() + ":" + files.size() + " ->" + (System.currentTimeMillis() - start));
try {
Thread.sleep(pause);
}
Expand All @@ -84,18 +74,12 @@ private void collect(Map<File, FileInfo> directories, Map<File, FileInfo> files,
private void recollect(Map<File, FileInfo> directories, Map<File, FileInfo> files, File dir) {
FileInfo fi = directories.get(dir);
if (fi == null) {
print.e("new directory!");
print.e(dir);
directories.put(dir, new FileInfo(dir));
}
else if (fi.lastModified != dir.lastModified()) {
print.e("directory changed (timestamp)");
print.e(dir);
directories.put(dir, new FileInfo(dir));
}
else if (fi.length != dir.length()) {
print.e("directory changed (length)");
print.e(dir);
directories.put(dir, new FileInfo(dir));
}

Expand All @@ -104,21 +88,14 @@ else if (fi.length != dir.length()) {
else if (f.getName().endsWith(".cfm") || f.getName().endsWith(".cfc")) {
fi = files.get(f);
if (fi == null) {
print.e("new file!!!");
print.e(f);
files.put(f, new FileInfo(f));
}
else if (fi.lastModified != f.lastModified()) {
print.e("file changed (timestamp)");
print.e(f);
files.put(f, new FileInfo(f));
}
else if (fi.length != f.length()) {
print.e("file changed (length)");
print.e(f);
files.put(f, new FileInfo(f));
}

}
}
}
Expand All @@ -129,4 +106,4 @@ public static void main(String[] args) {
new DirectoryWatcher(root, 5000L);
}

}
}
2 changes: 0 additions & 2 deletions core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
import org.osgi.framework.Version;

import lucee.Info;
import lucee.print;
import lucee.cli.servlet.HTTPServletImpl;
import lucee.cli.servlet.ServletContextImpl;
import lucee.commons.collection.MapFactory;
Expand Down Expand Up @@ -388,7 +387,6 @@ else if (installExtensions && (updateInfo.updateType == ConfigFactory.NEW_MINOR

}
catch (PageException e) {
print.e(e);
LogUtil.log("deploy", "controller", e);
sucess = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,27 @@
import java.net.InetAddress;
import java.security.Permission;

import lucee.print;

public class SecurityManagerImpl extends SecurityManager {

@Override
protected Class<?>[] getClassContext() {
print.ds();
// TODO Auto-generated method stub
return super.getClassContext();
}

@Override
public Object getSecurityContext() {
print.ds();
// TODO Auto-generated method stub
return super.getSecurityContext();
}

@Override
public ThreadGroup getThreadGroup() {
print.ds();
return super.getThreadGroup();
}

@Override
public void checkPermission(Permission perm) {
print.e("checkPermission:" + perm.getName());
// super.checkPermission(perm);
// Check if the permission is to exit the VM
if (perm.getName().startsWith("exitVM")) {
Expand All @@ -40,8 +34,6 @@ public void checkPermission(Permission perm) {

@Override
public void checkPermission(Permission perm, Object context) {
print.e("checkPermission:" + perm.getName());
print.e("context:" + context);
// super.checkPermission(perm);
// Check if the permission is to exit the VM
if (perm.getName().startsWith("exitVM")) {
Expand Down

0 comments on commit b0b8d64

Please sign in to comment.