Shaik Riyaz

Greenhorn
+ Follow
since Apr 17, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shaik Riyaz

yeah Thanks for the reply the sollution worked
11 years ago
The above issue has been resolved. I had to close the zip entry while iterating for file sizes of files inside WAR file of a EAR file.

11 years ago
Hello,

Iam developing a utility to compare Jar/EAR/WAR Files.

I am facing an issue while comapring EAR files i.e. I am able to get the sizes of files inside EAR file including WAR File , But I want to be able to iterate the WAR file (which is present inside EAR) and get sizes of files inside it.

The above funtionality would enable users to identify the file inside WAR file of a EAR file which has changed.

Please find below the code Iam using to get the contents and as can be seen I am able to get file name and file date timestamp of files inside WAR file but not the sizes.

Please let me know your thoughts regarding the approach which can be adopted.

Thanks in advance !!


Current Output:
In EAR comparision
OUTSIDE WAR FILE NAME:META-INF/MANIFEST.MF FILE SIZE:[ 25 ] FILE Time: [ 09/27/2012 09:56:48 PM ]
OUTSIDE WAR FILE NAME:META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp/deployment.xml FILE SIZE:[ 1348 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:META-INF/application.xml.20120405-163700.bak FILE SIZE:[ 833 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:META-INF/application.xml FILE SIZE:[ 833 ] FILE Time: [ 08/30/2012 01:56:54 PM ]
OUTSIDE WAR FILE NAME:project.pj FILE SIZE:[ 527 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:META-INF/ibm-application-bnd.xmi FILE SIZE:[ 835 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:deployment.xml.20120409-125442.bak FILE SIZE:[ 2458 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
In WAR comparision
WAR FILE NAME:samplewebapp.war
WAR FILE SizE:292765
WAR FILE Time:09/27/2012 09:56:48 PM
INSIDE WAR FILE NAME:samplewebapp.war/META-INF/MANIFEST.MF FILE SIZE: [ -1-1-1 ] FILE Time: [ 09/27/2012 09:56:48 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/sample.jsp FILE SIZE: [ -1-1-1 ] FILE Time: [ 08/30/2012 01:56:44 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/WEB-INF/ibm-web-bnd.xmi FILE SIZE: [ -1-1-1 ] FILE Time: [ 08/30/2012 01:56:52 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/xsl/sample.xsl FILE SIZE: [ -1-1-1 ] FILE Time: [ 08/30/2012 01:56:38 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/xsl/sample.xsl FILE SIZE: [ -1-1-1 ] FILE Time: [ 08/30/2012 01:56:46 PM ]

Needed Output:
In EAR comparision
OUTSIDE WAR FILE NAME:META-INF/MANIFEST.MF FILE SIZE:[ 25 ] FILE Time: [ 09/27/2012 09:56:48 PM ]
OUTSIDE WAR FILE NAME:META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp/deployment.xml FILE SIZE:[ 1348 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:META-INF/application.xml.20120405-163700.bak FILE SIZE:[ 833 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:META-INF/application.xml FILE SIZE:[ 833 ] FILE Time: [ 08/30/2012 01:56:54 PM ]
OUTSIDE WAR FILE NAME:project.pj FILE SIZE:[ 527 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:META-INF/ibm-application-bnd.xmi FILE SIZE:[ 835 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
OUTSIDE WAR FILE NAME:deployment.xml.20120409-125442.bak FILE SIZE:[ 2458 ] FILE Time: [ 08/30/2012 01:56:24 PM ]
In WAR comparision
WAR FILE NAME:samplewebapp.war
WAR FILE SizE:292765
WAR FILE Time:09/27/2012 09:56:48 PM
INSIDE WAR FILE NAME:samplewebapp.war/META-INF/MANIFEST.MF FILE SIZE: [ 25 ] FILE Time: [ 09/27/2012 09:56:48 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/sample.jsp FILE SIZE: [ 35733 ] FILE Time: [ 08/30/2012 01:56:44 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/WEB-INF/ibm-web-bnd.xmi FILE SIZE: [ 1411 ] FILE Time: [ 08/30/2012 01:56:52 PM ]
INSIDE WAR FILE NAME:samplewebapp.war/xsl/sample.xsl FILE SIZE: [ 22912 ] FILE Time: [ 08/30/2012 01:56:38 PM ]


11 years ago
Hello All,
While connecting to the database using java in unix environment i have encountered java.lang.UnsatisfiedLinkError: Can't find library ocijdbc9 (libocijdbc9.a or .so) in sun.boot.library.path or java.library.path. Please advice how to resovle this issue.

Please observe the below error trace

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't find library ocijdbc9 (libocijdbc9.a or .so) in sun.boot.library.path or java.library.path
sun.boot.library.path=/usr/java14/jre/bin
java.library.path=/usr/java14/jre/bin:/usr/java14/jre/bin/classic:/usr/java14/jre/bin:.:/opt/projects/gsd/lib:/opt/CA/ServiceDesk/lib:/usr/vacpp/lib:/usr/mqm/lib:/usr/mqm/java/lib:/usr/java14/jre/lib/sparc/client:/opt/controlm/ctm/exe:/usr/lib
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2044)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:910)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:189)
at dbmgr.ConnectionPool.newConnection(ConnectionPool.java:191)
at dbmgr.ConnectionPool.initPool(ConnectionPool.java:62)
at dbmgr.ConnectionPool.<init>(ConnectionPool.java:35)
at dbmgr.PoolManager.createPools(PoolManager.java:346)
at dbmgr.PoolManager.init(PoolManager.java:188)
at dbmgr.PoolManager.<init>(PoolManager.java:45)
at dbmgr.PoolManager.getInstance(PoolManager.java:52)
at cne.CneMsgHandler.getDatabaseInfo(CneMsgHandler.java:323)
at cne.CneMsgHandler.<init>(CneMsgHandler.java:128)
at cne.CneMsgHandler.main(CneMsgHandler.java:486)


Thanks in anticipation.

Originally posted by Bill Cruise:
The function removes the "f" and "," characters because you're telling it to. The first argument to the String replaceAll method is a regular expression. You have commas separating ranges of characters, so the comma is removed. You also have "\\xffff" at the end of the regular expression, so the f is removed. That should be "\\xff", the last two characters are just interpreted as "f". You can fix this by removing the commas and the last two "f"s from the second call to replaceAll.




Thanks for replying me.It is working fine for "f " character.But comma we are using to differentiate different expression.Do you think that it would be a valid expression to remove it ??Please suggest.

Is there anyway that we can include comma within expression without removing it from expression?
15 years ago
Does anyone know why these piece of code snippets eliminating the "f" and "," from the variable? The first outputs "temp"and "st" which is what I would expect. The second outputs "string2" which implies the regular expression doesn't match:

-------------------------------------------------------
public static String formatString() {
String s="��������abcdefghijklmnopqrstuv,,,,,,,,,!``~!@#$%^&*()--+={}[]|\'':;?/><.,wxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()----+=:;?.,1234567890";
String temp = Normalizer.normalize(s, Normalizer.DECOMP, 0);
String st=temp.replaceAll("[^\\p{ASCII}]","");
String string2=st.replaceAll("[\\x01-\\x08,\\x0b-\\x0c,\\x0e-\\x1f,\\x7f-\\xffff]", "");
return string2;


}


-------------------------------------------------------
15 years ago
Whenever I am trying to replace all the character rather than ASCII and some characters which are including in ASCII it is removing only letter "f" and comma character from the variable.Can anyone let me know why this is happening?Please find my code as below:

public static String formatString() {
String st="!@#$%^&*abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.";
String temp = Normalizer.normalize(st, Normalizer.DECOMP, 0);
String string1=temp.replaceAll("[^\\p{ASCII}]","");
String string2=string1.replaceAll("[\\x01-\\x08,\\x0b-\\x0c,\\x0e-\x1f,\\x7f-\\xffff]", "");
return string2;

}
15 years ago