Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Useful tool for Tomcat

 
Rory Lynch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am studying Servlets for the Cattle Drive and SCWCD
I am using the Head First book by Kathy Sierra and Bert Bates and Bryan Basham.

It recommends setting up two directory structures for each project, one for dev and one for deployment.
I have written a small program to create two new directory structires to save myself time.



Maybe someonelse will find this useful, I know I will
[ March 13, 2008: Message edited by: Rory Lynch ]
 
Dick Summerfield
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rory,
What a great idea to use Java for something useful! I thought it was only for solving Cattle Drive assignments!

I tried this out straightaway and I'm sorry to say it doesn't appear to work as is. Using method mkdirs instead of mkdir seems to work OK but I haven't read up on it yet so not sure if that's a good fix...

I'm getting into Servlets at the moment so I think I'll be needing this.
Thanks!

By the way - (general question) Is there any way to copy code from a forum thread in such a way that it does not paste into the editor as one lo-o-o-ong line?
 
Rory Lynch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dick

I cannot tell you how delighted I am that a fellow student of the Cattle Drive might use some of my code.

I actually had you in mind when I posted it because I knew you were a little further down the trail than I am, you're already in Sevlets Creek.

mkdir() creates the directory you specify

mkdirs() creates the specified directory and any required parent directories

the reason you needed mkdirs is because you were not starting from the same point as me, ie you did not have Tomcat installed in c:\tc6
and probably did not have c:\javafiles\servlets.

I should have thought more before posting, we live and learn.
You may need to edit the code to account for your chosen installation location.
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dick Summerfield:
By the way - (general question) Is there any way to copy code from a forum thread in such a way that it does not paste into the editor as one lo-o-o-ong line?

If you click on the "quote" or "edit" icons, you can copy it from the "source" including the formatting.
 
Dick Summerfield
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rory Lynch:
I actually had you in mind when I posted it...
That's very nice of you. Thanks.

the reason you needed mkdirs is because you were not starting from the same point as me
Ah yes, of course... The code is, let's say, relative not absolute.
As you so rightly say: ...we live and learn.
 
Dick Summerfield
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marilyn de Queiroz:
If you click on the "quote" or "edit" icons, you can copy it from the "source" including the formatting.


Thanks for the tip, Marilyn. Works a treat!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic