Results 1 to 7 of 7

Thread: 26 roots

  1. #1
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    10

    Question 26 roots

    test results just this moment, still being crafted:
    Java Code:
    file:/C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    file:/C:/Documents%20and%20Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    file:/C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    file:/C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    file:/C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.lsmft
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.lsmft
    file:/C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.lsmft
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.lsmft
    /C:/Documents and Settings/Owner/.Arachnophilia/CustomClasses/Arachnida.class
    Challenge: win thinks the 26 letters of the alpha-bet are someting you can bet your project on and then makes softlinks in a hardlinked world.....leaving millions to wonder what they should be wondering about.

    softlinks on win

    When I try to think of what exactly I need to do I get swamped by the simple fact that Java expects to be in a networked environment, I need to write a few files serverside in the manner I am used to. I tried to work the issue { writing to WEB-INF while on server. }, had to mark it as solved because I had too much to do. Today I am back to that issue and seek to get re-oriented. I am just replacing the dot class in the file string to get a name for a file to write to that is unlikely to conflict with other filename ideas, what I need some scope on is why if at all do we need file:// on the front of the filename if it is all server-side, and as well I do not know what to do with drive letter, 26 of them are pretty limiting anyway. Additionally there is file:///C:/ vs file:// vs /C:/ and I think what I need to end up with on Tomcat on Linux is /dir/dir/file with a slash starting off the file name.

    My thinking on the matter right now would be to do replace \..*$ with some filename extension I choose from new java.io.File("."); The file can go anywhere that I can find it from a shell.

    I have to test and develop on win, deploy on Tomcat on linux - that's just the way it is. Code really needs to work across the two os's and can be extensively hand-crafted to do this. At no time does this code need to run across the network, I will get the file manually or using a servlet to read it. All of this stays behind /WEB-INF/

    I've got too much altitude right now, I need to get the surface back in sight. I can write a custom servlet to test server-side and read it over http in the browser.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,093
    Rep Power
    29

    Default

    I don't understand what is your problem/question. Are you trying to find a unique place to put a file or a unique name for a file or ???
    Can you put different values into the init params in the web.xml file depending on the OS?
    Could you rephrase the question?

  3. #3
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    10

    Post get a simple file

    Just write a simple file, server-side. The above convoluted came from the fact ( apparently ) that doing a file write when deploying from NetBeans resulted in nothing but an ever-deepening morass. It occured to me while building out the test harness to just do:
    Java Code:
    FileWriter transactionRecord = new FileWriter( new File("."));
    or something of that nature, skipping all the work in the post about WEB-INF as that got to what we see above.

    I just need a plain file, not even a vanilla flavor to which I can write something and get it with what is called cPanel. It's better if it goes behind WEB-INF, most of it it is printable. The only thing that is not already in printable form gets converted and looks like this:
    Java Code:
    Z3JthACj2aXXD45ttAwez9x3HvGE6Da5oiNmn3cQ4xQ=
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,093
    Rep Power
    29

    Default

    It's better if it goes behind WEB-INF
    I assume there is one particulay WEB-INF folder you are refering to.
    There seems to be one for each webapp. I have 11 in my Tomcat 5.5 folder.
    Will do some expermenting to see if there is a path saved somewhere. Otherwise can you hard code the path in the servlet init parms?

    Here's one way to get a path. This is from a program named SurveyServlet. Obviously its class file must exist somewhere. The second line is from stdout created by the first line.
    System.out.println("resouce loc=" + this.getClass().getResource("SurveyServlet.class") );
    //resouce loc=file:/D:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/Norms/WEB-INF/classes/SurveyServlet.class
    Last edited by Norm; 08-19-2008 at 06:38 PM.

  5. #5
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    10

    Default 11 paths to Tomcat folder

    Quote Originally Posted by Norm View Post
    I assume there is one particular WEB-INF folder you are refering to.
    There seems to be one for each webapp. I have 11 in my Tomcat 5.5 folder.
    This is something I did not know.
    Quote Originally Posted by Norm View Post
    Will do some expermenting to see if there is a path saved somewhere. Otherwise can you hard code the path in the servlet init params?
    Well, yes, I can do pretty much whatever in init. It is getting a reliable path that is the objective, to hardcode the path I have to know what it is. If the file shows up in a normal manner, then I can fish around in cPanel and find it. There are some issues that are not understood here, thus I posted in advanced.
    Quote Originally Posted by Norm View Post
    Here's one way to get a path. This is from a program named SurveyServlet. Obviously its class file must exist somewhere. The second line is from stdout created by the first line.
    That is largely the approach I took in the post in servlets, I decided to do some digging when I came to removing the %20 from the string, since I do not have a manner of predicting what the path will look like, who knows if some other escaped character will show up and thus I thought to see what other information I could find.

    My code posted at the front of this post was first effort at converting the url escaped path to a normal string in the sense the server would handle a file path.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,093
    Rep Power
    29

    Default

    Since the value returned by the getResource() method is a URL, would the URLDecoder class decode it?
    Are there other methods in the URL class that will return the path to the file?

  7. #7
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    10

    Post other methods == brain fry

    Quote Originally Posted by Norm View Post
    Since the value returned by the getResource() method is a URL, would the URLDecoder class decode it?
    Are there other methods in the URL class that will return the path to the file?
    That is exactly the approach I started with. Somehow trying to achieve a certain and definite code approach, I ended up examining:
    Java Code:
    HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
    due to the issue of replacing file:/// with C://

    I was getting a possibly distracted tangent of soft-links on Win, but something was not synch'd in all the literature reports and documents I was reading. At that point or a short time later I decided to throw a rope as some of the files do not have roots as win thinks of roots. Hence the title of the thread. One ( or more ) of the lines in the test results is from URL Decoder of some kind, but I just saw a bust coming and was not working at the level that achieve reliable work. If I test sometning on win and get a bad path, so much - so good. If I am trying to run this on a server, I am not in an arena where testing can continue into depolyment. It has to be Zoe, not a study project.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •