• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

retrieve a file from a fileinputstream

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to retrieve a file from a fileinputstream
:roll:
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not that I see, but you can get the FileChannel from the stream, find the size of the file, and construct a new one from the data.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends what you mean by "retrieve the file". You can certainly read the contents of the file. But if you want to know the name and location of a file, there doesn't seem to be any way to do that. If you really need to find the file name, and have no other way to do this, I suppose you could read in the contents, and then search the file system for a file with the same contents. (Similar to using grep or find in Unix.) But this is pretty ugly. I'd strongly recommend a redesign of some sort so you don't have to do this.
reply
    Bookmark Topic Watch Topic
  • New Topic