Author: rob.stryker(a)jboss.com
Date: 2008-11-30 19:56:06 -0500 (Sun, 30 Nov 2008)
New Revision: 12156
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
Log:
Adding a major type mask constant
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2008-12-01
00:38:43 UTC (rev 12155)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2008-12-01
00:56:06 UTC (rev 12156)
@@ -27,10 +27,11 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
public class ServerLogger implements IJBossServerConstants {
-
+ public static final int MAJOR_TYPE_MASK = 0x11111111 << 24;
private static ServerLogger instance;
public static ServerLogger getDefault() {
if( instance == null ) {
@@ -76,11 +77,21 @@
}
}
- public File getServerLogFile(IServer server) {
+ public static File getServerLogFile(IServer server) {
File f = server == null ? PLUGIN_LOCATION.toFile() :
PLUGIN_LOCATION.append(server.getId()).append(LOG).toFile();
if( !f.getParentFile().exists() )
f.getParentFile().mkdirs();
return f;
}
+
+ public static IServer findServerForFile(File file) {
+ if( file == null )
+ return null;
+ IServer[] servers = ServerCore.getServers();
+ for( int i = 0; i < servers.length; i++ )
+ if(getServerLogFile(servers[i]).equals(file))
+ return servers[i];
+ return null;
+ }
}
Show replies by date