Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to copy file in java

 
Bilal Ali
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
We have java class files deployed on our server (Tomcat) , the server is linux based , we also have 4 WINDOWS clients , the java file contains the logic of creating file on the server , now the thing in which I am stucked is that how to copy this file from LINUX server to WINDOWS client machine , please guide.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just let the clients download the file using HTTP, right?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In more detail:
  • Put the file somewhere on the server where it's accessible by Tomcat.
  • Present the user with a web page containing a link that points to the file on the server.
  • The user clicks on the link and saves the file on his/her disk using the browser.
  •  
    Bilal Ali
    Ranch Hand
    Posts: 66
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Jesper Young:
    In more detail:
  • Put the file somewhere on the server where it's accessible by Tomcat.
  • Present the user with a web page containing a link that points to the file on the server.
  • The user clicks on the link and saves the file on his/her disk using the browser.

  • I tryed this approach but ather than asking for the save option the whole file in opoened in the browser.I mean to say that all of the text of the file is displayed on browser window/page rather than asking me for the save or open option.
     
    Ananth Chellathurai
    Ranch Hand
    Posts: 349
    Eclipse IDE Hibernate Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Are you aware of the file type? Will it be the same?

    Regards
    Ananth Chellathurai
     
    Bilal Ali
    Ranch Hand
    Posts: 66
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Ananth Chellathurai:
    Are you aware of the file type? Will it be the same?

    Regards
    Ananth Chellathurai


    This is a text file and it will not change.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic