Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Malte Wannerskog

Ranch Hand
+ Follow
since Jan 06, 2011
Malte likes ...
Java PHP
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Malte Wannerskog

Paul Clapham wrote:Well, jars don't really have the concept of "folder" either.

Really, you should have given up several posts ago and redesigned your system to conform to reality. It's clear what you want; it's just too bad that the tools you chose to implement it don't support your requirements. So this is the time to declare defeat and redesign.



I get what your saying, but sometimes you have to work with legacycode and make the best of what you have. I realize that the best option always is to redo it the right way and maybe that's just what ill have to do! Ill look at it tomorrow and decide what my best option is.
Thanks for your help.
6 years ago

Paul Clapham wrote:And what will you do if the URL doesn't represent a file? Like for example, if you (as you should) put your resources into a jar?



I have my resources in a jar.
This is for a special method getFile(String path) which fetches a file from resources (the jar), but i need support to pass a folder in addition to passing a filename.
6 years ago

Paul Clapham wrote:How would you tell if it's a folder? And what would you do if you could find out? The URL specification doesn't include "folder" or "directory" as one of its technical terms, and the Java URL class doesn't provide any way to get a list of URLs based on the theory that a URL represents a folder.



Create a File object from the URL and determine from that.
6 years ago

Paul Clapham wrote:You can't. It doesn't make sense for a directory to be a resource, and it doesn't make sense to open an InputStream to read a directory either.

If you have a design where you don't know the names of all your resources, then the usual way to deal with that is to include a "table of contents" resource which contains a list of the names.



Thanks for your reply!

I guess i could load the resource as an url, determine if its a folder or a file, and if its a folder i can list the contents in that folder and load the resources one by one.
6 years ago
I really hope someone can help me with this!

In my code im reading resources like this:

Lets say I have a jar-file containing the following structure

helloworld.txt
dir/file1.txt
dir/file2.txt


Now if i pass "helloworld.txt" to getSystemResourceAsStream() I get an InputStream containing the file helloworld.txt.
But since i actually dont know the names of the files inside "dir" i want to just pass "dir" to getSystemResourceAsStream(). But if I do, how can i properly convert the returned InputStream to a directory with the beloning files?

Thanks!
6 years ago
Hi,

I am writing an application which i want to start a second external application.
I know this can be achived with Runtime.getRuntime().exec(), for example:



However, i want the solution to be platform independat. For example, lets say i want my application to launch skype.
I dont know if its a windows or apple system that will launch my application, and i dont know where skype is installed.

How would you approach this?

Thanks in advance!
6 years ago

Roel De Nijs wrote:

Malte Wannerskog wrote:It does not say that you have to participate in an instructor-lead course?


Maybe you should read a bit more carefully. Beneath the overview of the certification paths with the approved trainings, you can read the following:
*Approved Training:
Only instructor-led in-Class or instructor-led online courses (includes Live Web Classes – LWC and Live Virtual classes – LVC) from the above approved list of Oracle University courses count toward the training requirement. Self Study CD-Rom and Knowledge Center (including Recorded Web Courses – RWC) courses are excellent study and reference tools but DO NOT meet the Hands-on Course Requirement for certification.



Sorry, should have read more carefully. Thanks for the info!
Does anyone know for a fact that you actually have to attend an instructor-lead course and that it's not enough with a self-study cd-rom?

Reading at Important Changes to Java, and Oracle Solaris Certifications it says
"One of the courses in each list below will be required for each certification path. Candidates do not need to complete more than one course for each certification path."

It does not say that you have to participate in an instructor-lead course?

Eric Kizaki wrote:I read the K&B study guide book twice and did all the work in it. I would usually get at least half of the exercise questions right on the first try. Additionally, I barely passed Master Exam A on the first try.

The new OCP Java SE 6 Programmer Practice Exams book is hardcore. I am not a fan of retaking exams, but I guess that is what you have to do with this book. The trick questions are brutal unless you have a laser like eye.

Has anyone else used this book? What has been your experience?



I did the first 2 exams in the practice exams book. I got
Practice Exam 1 - 53%
Practice Exam 2 - 61%

I then studied 2-3 more days and passed the real exam with 88%.

Khoder Wassouf wrote:Congratulations!


I myself also attempted the Scjp Exam on the 20th Jan but Sadly I failed!......................But Im planing on re-doing it!............Some Task questions were just too hard!...Did you find any of them hard too?



I'm sorry to hear that you failed. Just get back to the studies and do some more mocks and Im sure you'll make it next time!
As I mentioned in my original post I found the real exam alot easier than all of the mocks I took. I did not find any questions on the real exam too difficult.
7 years ago

Andreas Svenkson wrote:
SCJP Sun Certified Programmer for Java 6 Study Guide by Katherine Sierra and Bert Bates (K&B)



I passed the OCPJP/SCJP exam yesterday and that was the only book I used (together with various mockexams). Youll also get some Mock Exams with it that are good.
Regarding the format... The book is pretty big, roughly 800 pages, but i read it lying down in bed with no problem .

Best thing about the book in my opinion were first of all that it is well written, it is fun to read and easy to understand. It points out important topics for the exam and it is easy to look up a specific exam objective in the book that you need to study more. The questions in the book are also good.

Have no opinion regarding the other books you mention.

Good luck on your OCPJP/SCJP journey!

Somprakash Rai wrote:Can anyone tell me what all topics wiil be covered in SCji(plus)
Thanks in advance...
(Som Prakash Rai)



Read my previous post...
Also check the SCJP FAQ
Thanks all.
Im thinking Developer exam next.
7 years ago
Took the OCPJP (310-065) exam today and passed with 53/60 - 88%!

Declarations, Initialization and Scoping....100%
Flow Control...........................................90%
API Contents..........................................85%
Concurrency...........................................80%
OO Concepts..........................................70%
Collections / Generics.............................100%
Fundamentals.........................................88%

Was not allowed pen & paper but got a erasable sheet and a marker.
Real exam was alot easier than the mocks i took.

Preparation:
Started by reading the entire study guide by K&B.
I then spent 2 weeks of actual studying working through the questions in the study guide and taking mock exams. Since I've had vacation I could spend full days studying during these 2 weeks.

For mock exams I did Master Exam from K&B, ExamLab and some of the exams from the Practice Exams book from K&B. Also did most of the topic-wise exams at JavaChamp

Mock Exam Scores
ExamLab Diagnostics - 52%
ExamLab Practice Exam 1 - 41%
K&B (Practice Exams book) Practice Exam 1 - 53%
K&B (Practice Exams book) Practice Exam 2 - 61%
ExamLab Final Exam - 52%
K&B Master Exam A - 81.95% (Worked through the quizes and open/closed book a week before, so many of the questions were familiar).

I found both books from K&B to be excellent, and I found ExamLab to be a very good learning tool (though difficult!), Thanks to M.Devaka for providing this completly free!
Will be sure to make a donation!

Also many thanks to the people behind JavaRanch and the people in these forums!
7 years ago

Somprakash Rai wrote:Can anyone tell me about what all topics scjp includes ?



Here

Scroll down and you will find all Exam topics.