This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Useful tool for Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Useful tool for Tomcat" Watch "Useful tool for Tomcat" New topic
Author

Useful tool for Tomcat

Rory Lynch
Ranch Hand

Joined: Aug 03, 2007
Posts: 95
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 ]

I wish that for just one time, you could stand inside my shoes.<br />You'd know what a drag it is to see you.
Dick Summerfield
Ranch Hand

Joined: Oct 04, 2007
Posts: 90
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

Joined: Aug 03, 2007
Posts: 95
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dick Summerfield
Ranch Hand

Joined: Oct 04, 2007
Posts: 90
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

Joined: Oct 04, 2007
Posts: 90
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Useful tool for Tomcat
 
Similar Threads
Servlet in Package Issue
Package doesn't exists - error!!- How to resolve?
package com.example.model ERROR
Useful tool for Tomcat users on Windows
classpath issue?