I have a link for OneDrive. The format is https://onedrive.live.com/?cid=XXXXXXXXXXXXXXXX&id=XXXXXXXXXXXXXXXX%XXXXX
The link is public, it's not mine and new files is often added in it. My question is simple. What is the best way in Java to list all the file/folder from this link and to download a file ?
I tried HtmlUnit but it give a big javascript error.
Since the link is public, do I really need to use a OneDrive SDK ? I really don't know how to proccess with OneDrive... Thank's for any help
https://github.com/isac322/OneDrive-SDK-java This SDK will help you get the path and download the folder.
Related
First of all sorry my English is not good I will accept any edits of my question, this is the library link.
I have already test the library and worked well, This is the result.
But I need to get files located in storage path /storage/emulated/0/ to a treeview recyclerview something like this.
Codes
Since the codes are large I cant post them here so the codes are same located in this link. Thank you for your time.
I'm currently using Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) as a path. I have requested android.permission.WRITE_EXTERNAL_STORAGE. I am targeting SDK 30. I have had success reading and writing a file on Android 8 and Android 11, but not Android 10. Adding android:ignore="ScopedStorage" and android:requestLegacyExternalStorage="true" to my AndroidManifest.xml didn't work.
Reading through the official docs, it's very confusing. I tried an alternative approach with an ACTION_OPEN_DOCUMENT_TREE indent, but all I could navigate was the Downloads folder. I couldn't get to the Documents folder.
There are multiple questions on here that are similar, but don't quite get to the nub of the matter for me. Can anyone please share some light on how to do something as basic as simple file access to the Documents folder?
Actually, the problem was that on this particular Android 10 device there was no "Documents" folder. Manually creating one fixed it. So the real gotcha is that Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) sometimes doesn't give you a "Documents" directory depending on the device.
However, I'm not convinced this is the correct way to do this with Android 11 (even though it's currently working for me).
I'm in doubt about something. I'm developing a Java Desktop application and I have a problem.
I need to get the current local folder that my application (jar file) is in user system. And after this, to search inside of this same folder for some files (like all .txt file, for example). And finally, get the name of only one of this files and converts to string.
Someone can help me?
Antecipate thanks.
May be the getCanonicalPath() and getProperty() functions could help you, since you don't show any code I can't make you any example, but may be looking this could help you a little.
And also there is a similar question here
i had made an android app
i want to share this app with a person
the person must replace 1 line code in the source so it works for him (it is a link in the source)
but the thing is that i don't want to give the source to anyone .
is there is a way to edit and apk file and change the link to his own link
if there is a way i think i could automate the thing , i could make a .exe file when he press it it will ask him for the link when he press OK it will edit the apk for him then give it to him
is this scenario possible ?
If you really want to do this you can put file containing URL to raw resource folder. Your friend can unarchive apk, change url and compress apk back. No special "hacker" skills required.
But you better add this url to preferences and let your friend type it by himself.
P.S. you can edit source code. But it's quite tricky )
Hai,
I am using Java GWT. In this i want to load one html file.
htmlPane.setContentsURL("http://www.chellasoftapp.com/ATBrowser/images/disclaimer.html");
htmlPane.setContentsURL("images/disclaimer.html");
Which one be the faster? How is it works?
In images folder of WAR I placed that html file. Is it correct place? Or Where can i upload this?
Give suggestion for this issue.
Thanks in advance.
Regards,
Sathya.A
This solution:
htmlPane.setContentsURL("http://www.chellasoftapp.com/ATBrowser/images/disclaimer.html");
has quite big disadventage. It doesn't work in development on local machine.
I would use
htmlPane.setContentsURL(GWT.getModuleBaseURL() + "/images/disclaimer.html");
This one always works, doesn't matter if your application is at http://www.chellasoftapp.com/ATBrowser/ or at URL root: http://www.chellasoftapp.com/
Can you put .html file into images directory? Yes you can, and technically it is still valid, however, it is not readable and not obvious. I.e. it is hard to understand for other developers.