How to convert a string into a file in java




















Thanks so much for your reply. Yes, I will move my codes in servlets within the week but as of now I placed it in JSPs for testing purposes. Thanks again. Darren [ September 10, Message edited by: Darren Alexandria ]. Freddy Wong. I like If yes, then it definitely won't work. You can't assigned a File object into a String object. You shouldn't do that. If you want to save the files into the database, you should save the content of the file and not the File object. And as I understood all what you need is the file name the last part of complete path and its size,right?

Wow, thanks to your replies. Package Access Modifiers Encapsulation. JSONObject; import org. Reinforcement Learning. R Programming. React Native. Python Design Patterns.

Python Pillow. Python Turtle. Verbal Ability. Interview Questions. Company Questions. Artificial Intelligence. Cloud Computing. Data Science. Angular 7. I have code that asks the user to input a log file name so it knows what file it is to parse and sort. To be able to parse correctly, the FileSource. So, the input String needs to be converted to a File. How would this be done? See this javadoc for more information about Files.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 5 months ago. Active 9 years, 5 months ago. Viewed 99k times. Improve this question. David Kroukamp The answers already posted have addressed the simpler interpretation of the question.

But are you asking about some complexity?



0コメント

  • 1000 / 1000