sciuriware
asked on
How to access files/folders on a MTP device?
On MSWindows XP and Vista, MP3 players nowadays will not be visible
as device lettered partitions, but as 'devices' accessible through a path that begins at 'desktop'.
How do I find that path from JAVA?
;JOOP!
as device lettered partitions, but as 'devices' accessible through a path that begins at 'desktop'.
How do I find that path from JAVA?
;JOOP!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try: File.listRoots()
ASKER
CEHJ: that gives me the desktop with only the desktop icons in it.
objects: that gives me all drive letters.
When an MTP device is connected a pop up shows named "Portable Device".
You can double click "Open device to view files using Windows Explorer"
Windows explorer then shows (in case of a Creative ZEN mp3 player):
"Storage Media" at the address "My Computer\My Zen".
A file manager like Total Commander shows in directory tree mode:
[ ] Desktop
- [ ] My Computer
.................
+ [ ] My Zen
How do I get those links?
;JOOP!
objects: that gives me all drive letters.
When an MTP device is connected a pop up shows named "Portable Device".
You can double click "Open device to view files using Windows Explorer"
Windows explorer then shows (in case of a Creative ZEN mp3 player):
"Storage Media" at the address "My Computer\My Zen".
A file manager like Total Commander shows in directory tree mode:
[ ] Desktop
- [ ] My Computer
.................
+ [ ] My Zen
How do I get those links?
;JOOP!
> objects: that gives me all drive letters.
I realise that, does it not associate it with a drive?
I realise that, does it not associate it with a drive?
ASKER
No that's the main problem ever since XP.
;JOOP!
;JOOP!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>CEHJ: that gives me the desktop with only the desktop icons in it.
That will give you the Desktop directory. If that's where the filesystem of the MP3 device is mounted then there shouldn't be a problem although it seems odd it's not being mounted as a file system root
That will give you the Desktop directory. If that's where the filesystem of the MP3 device is mounted then there shouldn't be a problem although it seems odd it's not being mounted as a file system root
ASKER
CEHJ, if you can lay your hands on a Creative ZEN, you will find out.
For the moment I can only exchange fiules via Windows Explorer.
;JOOP!
For the moment I can only exchange fiules via Windows Explorer.
;JOOP!
ASKER
objects, same message as to CEHJ.
I was surprised too.
Anyway, I can't even see 'My Computer' in my Desktop folder.
;JOOP!
I was surprised too.
Anyway, I can't even see 'My Computer' in my Desktop folder.
;JOOP!
ASKER
P.S.:
Anyway, I can't even see 'My Computer' in my Desktop folder in a JFileChooser{}.
;JOOP!
Anyway, I can't even see 'My Computer' in my Desktop folder in a JFileChooser{}.
;JOOP!
'My Computer' is not a subdirectory, or a shortcut, but i'm not sure what it is
ASKER
That's the point.
;JOOP!
;JOOP!
Can you post the result of
dir "%USERPROFILE%\Desktop"
?
dir "%USERPROFILE%\Desktop"
?
ASKER
>>>
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>dir "%USERPROFILE%\Desktop"
Volume in drive C is NutkinSys
Volume Serial Number is EC0F-456D
Directory of C:\Documents and Settings\joop\Desktop
04-10-07 17:16 <DIR> .
04-10-07 17:16 <DIR> ..
04-04-07 15:01 2 855 Block Out.pif
30-11-05 12:39 564 MAP Kaibab.lnk
02-06-07 17:39 564 MAP Ratufa.lnk
30-11-05 12:40 568 UNMAP Kaibab.lnk
02-06-07 17:40 568 UNMAP Ratufa.lnk
5 File(s) 5 119 bytes
2 Dir(s) 2 265 378 816 bytes free
C:\>
<<<
;JOOP!
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>dir "%USERPROFILE%\Desktop"
Volume in drive C is NutkinSys
Volume Serial Number is EC0F-456D
Directory of C:\Documents and Settings\joop\Desktop
04-10-07 17:16 <DIR> .
04-10-07 17:16 <DIR> ..
04-04-07 15:01 2 855 Block Out.pif
30-11-05 12:39 564 MAP Kaibab.lnk
02-06-07 17:39 564 MAP Ratufa.lnk
30-11-05 12:40 568 UNMAP Kaibab.lnk
02-06-07 17:40 568 UNMAP Ratufa.lnk
5 File(s) 5 119 bytes
2 Dir(s) 2 265 378 816 bytes free
C:\>
<<<
;JOOP!
That's a sparse but intriguing desktop ;-) Haven't come across that listing before. Is it listing Out.pif as a Unix-like block device? Could that be the player?
ASKER
Block Out is an MSDOS game.
I wrote my own Program Manager in Java, so my Desktop is a bit empty.
Should I try to put My Computer in there? How?
;JOOP!
I wrote my own Program Manager in Java, so my Desktop is a bit empty.
Should I try to put My Computer in there? How?
;JOOP!
>>Block Out is an MSDOS game.
Sorry - misread that then. What about MAP and UNMAP?
Sorry - misread that then. What about MAP and UNMAP?
ASKER
Shortcuts to .bat scripts
;JOOP!
;JOOP!
All quite strange. So you see an icon representing the player on the desktop
ASKER
No. in the system tray only.
;JOOP!
;JOOP!
ASKER
If even objects and CEHJ don't know of a solution, I conclude that such access
must be made through JNI code.
In the mean time I discovered that the latest release of Total Commander (file manager) 7.02
has a command to put my MP3 playerin a pane, even not having a drive letter.
The command is: Command->Open Desktop Directory.
In order to make this solution visible to searchers I will give you some points.
Thanks.
;JOOP!
must be made through JNI code.
In the mean time I discovered that the latest release of Total Commander (file manager) 7.02
has a command to put my MP3 playerin a pane, even not having a drive letter.
The command is: Command->Open Desktop Directory.
In order to make this solution visible to searchers I will give you some points.
Thanks.
;JOOP!
Has this got a USB interface?
Assuming yes, you might try to ignore the FS and go straight to the device using something like:
http://jusb.sourceforge.net
http://jusb.sourceforge.net
ASKER
Yes it has.
I'll dig into this.
;JOOP!
I'll dig into this.
;JOOP!