0

I am beginner in Java. I have a USB stick with some information stored.

I want to write Java code on Linux platform. After inserting USB stick in Linux machine, I want to mount USB stick in Java code and read the USB Stick content.

I need help to write Java code to Mount USB Stick and read the USB content. After spending some time I got to know that Shell Command is the best way to execute in Java.

I need help to write Shell command to identify the Mounting Location in Java.

Thanks, Manoj

map125
  • 83
  • 1
  • 2
  • 8
  • It depends. Do you want to read the _files_ on the stick, or the _filesystem_ and/or _partition_ data? If all you want to do is the former, then the standard Java File I/O will work. You just need to know where the USB stick is mounted. For non-file data like the raw filesystem or raw flash data, I suppose you could write a Java app, but it wouldn't necessarily be an ideal tool for this job. –  Oct 08 '15 at 16:15

1 Answers1

0

i know this wont be helpful but... WHY?!?!? lol

also i don't know any thing about java, but i did find this: Want to invoke a linux shell command from Java

i suppose if you're asking how to find the usb device and mount with a linux command... you're going to need to watch DMESG or log/messages or log/syslog depending on distro...

i dont know, i hope this points you in the right direction...

Community
  • 1
  • 1
knope
  • 32
  • 8