Shake Sajan

Greenhorn
+ Follow
since Sep 29, 2009
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shake Sajan

Hi all,

I was trying to use JWS for installing my java application automatically. I see that every time the application is installed to a particular location in the user profile. I know that for the second time installation of the same application, the existing app would be auto updated to same location.

Is there any way to change the install location for the application installation. Probably to change from the user profile location (C:\Documents and Settings\User\...) to any other user provided location (D:\MyApp\). So this will help me to install the multiple versions of same application in multiple location.

As per my understanding, I think this cannot be achieved by changing the Java Cache Location as all the time apps would be installed into the updated location.

Hope I put across my question (requirement) in a clear way. This might sound crazy, but still I have such requirement !!!

I see a similar thread with subject "Setting custom location for Java WS cache" unanswered.

Appreciate any and all responses...
Thanks in Advance..
13 years ago
Hi friends,

I am planning to take scwcd certification by Jan 2010 mid. I hope latest scwcd is based on JEE 5, and would be better to go for it.
I am comfortable and confident in servlet only. So feeling bit nervous.

Any and all suggestions and tips on how to work out are appreciated.


Thanks in advance.
Well, thats awesome...
I just could not learn regex in that much depth. I found a regex details in one site, tried expecting the result.

Anyways thanks again Rob.
14 years ago
ouch!!!

I was not knowing that String matches used Pattern-Matcher classes. Thanks for sharing info. Then I feel its better to use Pattern-Matcher classes...

From some examples and tut, I also got to know there is some significance for '.' in regex. But since my code works fine, i did not checked for that.
And also i thought if we give inside brackets '()', it wont make any problem.

Let me correct it to: "(" + fn + ")[\\w]*(\\." + ex + ")";

I hope now it would work fine. Please let me know any problem..

Thanks once again...
14 years ago
Thank you friends for the response.

I got the solution for that.

As Rob mentioned, I can do it in diff ways. And found that String matches is the easiest and lightest way.
And I could able to get the proper regular expression.

like String filePattern = "(" + fn + ")[\\w]*(." + ex + ")";
and name.matches(filePattern);

It works perfectly.

I can do it also using Pattern and Matcher classes. But as it is simple I opted out creating more objects...


Anyways thanks for all the responses...
14 years ago
This is how I do:

final String fn = "Abc2009";
final String ex = "dat"
File ff = new File(<directory path>);
File[] files = ff.listFiles(new FilenameFilter(){
public boolean accept(File dir, String name)
{

return name.startsWith(fn) && name.endsWith("." + ex) && (name.length() > (fn.length() + ex.length() + 1));
}});
System.out.println("no. of files: " + files.length);


But the return statement doesnt seem to be good enough, means its just using some calculation rather that not using standard api (regex).

[Its not like I am not working. I am working parallely to findout the solution. But I felt like, if I go thr the complete regex api, it will take time for me...
And also I thougt, ppl who are experienced would be reading this forum and would be giving any solution...]

Thanks for the response...
14 years ago
Friends,

I am not much familiar with regex and sorry to say that I have not enough time to go through regex tutorial...
I have a question, like;
I need to find out the files in a directory starting and ending with some string.
start string, filename: "Abc2009"
end string, extn: ".dat"

And in the directory, I expect only one file (in most scenarios).

Now how I do is;
File f = new File(filename + "*" + extn); // Not working. f.exists() returns false.
File f = new File(filename + "[{*}]" + extn); // Not working. f.exists() returns false.

How to use the regular exp which shows anything after filename???

I also used FileNameFilter in the parent dir. Then am getting files. But I would like to do it using regular exp so that i can directly get the file.

Please respond..


Thanks and regards.
14 years ago
well, thank you for response.

Since I am using eclipse for creating the jar file, I could not find any option to include the referred resources or jar files explicitly.
And Manifest.mf file is inside the jar file, I am not able to edit it.
I thought, since using eclipse, the required resources and jar file path would be added into the manifest by the eclipse ide.

So what you think, how can I resolve this issue?
14 years ago
Hi friends,

I could not able to run java main class properly. This is how I do;

I have a java project created in eclipse, say Abc. Project has build path to external jar files. I created the jar file Abc.jar, exported from eclipse.
So inside the jar file I have lib folder in which the external jar files(ExtJar.jar) are stored.
I went to that folder through command prompt, and tried to run the java class. like:

java -cp Abc.jar com.javalabs.examples.Abc

But it says, class not found; that class belongs to external jar ExtJar.jar file.

As an alternative trail, I tried : java -cp Abc.jar;lib\ExtJar.jar com.javalabs.examples.Abc

The package structure and folder structure are correct.

So how can I set the path for the external jar files???

I hope my doubt is asked clearly.

Any and all suggestions are appreciated. Also let me know in case of any confusion in the question.

Thanks and Regards.
14 years ago
Guys, One more addon to the previous thread, I forgot to mention the exam details.

I appeared for SCJP 6.0. Had 60 questions and 58% was the cutoff. Thank god I made 51 correct...

The exam contained few questions from generics. That is the only portion where I feel is new one. Remaining all questions were same with the previous papers, I guess (Coz, mostly I went through scjp 1.2 mocks...).


Thanks...
14 years ago
Guys,

I also made it... 85%. I could have reach to 90%, but Alas... It was an horrible day that I had to wait 5 hrs for taking the exam due to some problem in the test center... Anyways happy that I cleared it with descent score...

Few things I would like to share with...

1) If you just want to score in the certification [just cheat like me]

[Edit: paraphrased. If you post further information on cheating your account will be locked.]
14 years ago
Guys, Thank you for all the tips. I am thinking to take certification this weekend. Please provide all the links for online mock exams as I cannot download or install any simulators or materials(so sad!!!)...

Thanks in advance...
Congrats Linda ...

Even I am also preparing to take exam this weekend. But when I take mock exams, i am not able to reach 65%. So feeling bit nervous... Any and all tips are welcome!!!
14 years ago