How to get a file’s parent folder properly in java?

By W.Zh

In java , file normally is a relative file, which means that these two are different in java:

        File f = new File(“./file1.txt”);
File f1 = new File(“file1.txt”);

f1.getParent() will get an error as it return a null. so how to get parent folder of a file normally by this way:

f1.getAbsoluteFile().getParent();

Advertisements

Logging in Weblogic

By. W.ZH

Basically for J2EE/JAVA logging, you have choice among: Log4J, Apache Commons Logging and also the
SLF4J . But for using weblogic server , oracle has one called  Oracle Diagnostic Loggings. Here some article can help:

log4J in your application of WLS:

http://www.theserverlabs.com/blog/2010/04/22/dynamically-changing-log-level-with-weblogic-log4j-jmx-and-wlst/

ODL Manage in WLS EM

http://docs.oracle.com/cd/E15523_01/core.1111/e10105/logs.htm#CHDCCHIE

One example for ODL

http://oracamp.com/blog-oracle-diagnostics-logging-odl-application-development

firewall iptables

[root@yourserver tmp]# service iptables start
[root@yourserver tmp]# service iptables stop
[root@yourserver tmp]# service iptables restart
[root@yourserver tmp]# service iptables status