security - is there anyway to know server file directory structure in java? -


I am trying to access a remote file on the server for one study purposes.

My server is as simple as the following:

  1. This is a basic Spring MVC project
  2. This is an index that is "HelloWald" and existing server time

    What I'm trying to do is down:

    1. Login URL (for example, http: //192.168 .0.1: 8080 / test )
    2. Find the absolute path to the index that is somewhere on the server (remote file)
    3. "HelloWald" to "Hi, John!" Open and Edit

      I already tried with HttpUrlConnection, but the methods of that class did not match my objectives The second attempt was with the file class. I have put a URI in the file, but the URI only considers the "file: //" protocol.

      How do I change that text to a remote server computer?

      3 that are not using 2 codes:

      1. Use SSH to access the server and change index.html using your worldwide shell text editor (div class = "text-mail" itemprop = "text">

        Such as Vi, Nano etc.)

      2. Use SFTP to access and overwrite the server's file system index.html in a new string Or version.
      3. Create a REST -interface on your server that allows you to change the content. This coding is required and I do not know whether the amount of effort is actually appropriate for your purposes.

        Edit:

        Do you think you want to change a remote file without any 'interaction' of this remote server, Such as a REST-interface or whatever it is possibly so easily, it will create a great security vulnerability for the system. That's why you always need to contact the server, e.g. Through a REST -interface or preference, you can not type in some java code and magically modify a remote file. With the only Java you can do that the only thing is to access the server via ssh or HTTP and it can be accessed by a remote server It means that you have to do some work on your server side to make such modifications possible.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -