• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

send/receive file WebDav

 
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there.
I have searching internet for 3 days but i couldn't find any good documentation/tutorial about Webdav.
What i am trying to do is send/receive file, list inside of a folder, create and delete folder.

I really appreciate for any help.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And the client would be an android app? It's kind of unusual for a mobile app to handle files (or resources) so explicitly.
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:And the client would be an android app? It's kind of unusual for a mobile app to handle files (or resources) so explicitly.



Dear Ulf, Thanks for reply.

Yes, it is an Android App. I know some guys doing it because i saw some app in Google Market.
If it is unusual then could you guide me to usual way.

Regards
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That depends on what problem you're trying to solve.
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to send csv file to PC from Android, read csv file from PC, delete csv file and folder located on PC.
So, basically i want to solve entire file folder activities.

Regards
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Putting a REST WS on top of those operations would work. Or -if you really want to use WebDAV- something like https://github.com/aflx/Sardine-Android should help.

By the way, you should have noticed by now that the Saloon signature does not support HTML tags: https://coderanch.com/how-to/java/UbbCode
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ulf

I have already tried Sardine but i could not success for it because there was no enough documentation. (Or may be there was but i couldn't see it)
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Huh. The javadoc comments in the Sardine interface look pretty substantial to me, and the methods themselves pretty straightforward. I'd have guessed that one could start with that.
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ulf
I have managed how to use sardine but i am facing following error.

Main activity


and this is entire WebDav class


This is entire stack trace.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please edit your post so that the codetags actually work (they are disabled right now).
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Please edit your post so that the codetags actually work (they are disabled right now).


I just did that - you (Ibrahim) had BB Code disabled which prevented the code tags from working. Make sure when you use code tags that BB tags are on...
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting - so Sardine uses the Simple library, which is supposed to be Android compatible. But it uses classes in the javax.xml.stream package, which isn't part of the Android API. Did you include the two StAX jar files that come with Simple in the app?
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ulf and Steve
Thanks for information. I have solved my problem by HttpRequest.
Simply get html page and parse it. Solved my problem for now. However, i am facing new problem when trying to send file to Webdav.
I got Caused by: java.lang.NoClassDefFoundError: de.aflx.sardine.SardineFactory. I searched on Google but it shows me ONLY four results.

Thank you so much.

following log is my error log

[code=java]05-15 01:39:03.062: W/dalvikvm(4170): threadid=1: thread exiting with uncaught exception (group=0x419ddba8)
05-15 01:39:03.072: E/AndroidRuntime(4170): FATAL EXCEPTION: main
05-15 01:39:03.072: E/AndroidRuntime(4170): Process: jp.co.android.SDcontactlist, PID: 4170
05-15 01:39:03.072: E/AndroidRuntime(4170): java.lang.IllegalStateException: Could not execute method of the activity
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.view.View$1.onClick(View.java:3823)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.view.View.performClick(View.java:4438)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.view.View$PerformClick.run(View.java:18422)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.os.Handler.handleCallback(Handler.java:733)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.os.Handler.dispatchMessage(Handler.java:95)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.os.Looper.loop(Looper.java:136)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-15 01:39:03.072: E/AndroidRuntime(4170): at java.lang.reflect.Method.invokeNative(Native Method)
05-15 01:39:03.072: E/AndroidRuntime(4170): at java.lang.reflect.Method.invoke(Method.java:515)
05-15 01:39:03.072: E/AndroidRuntime(4170): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-15 01:39:03.072: E/AndroidRuntime(4170): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-15 01:39:03.072: E/AndroidRuntime(4170): at dalvik.system.NativeStart.main(Native Method)
05-15 01:39:03.072: E/AndroidRuntime(4170): Caused by: java.lang.reflect.InvocationTargetException
05-15 01:39:03.072: E/AndroidRuntime(4170): at java.lang.reflect.Method.invokeNative(Native Method)
05-15 01:39:03.072: E/AndroidRuntime(4170): at java.lang.reflect.Method.invoke(Method.java:515)
05-15 01:39:03.072: E/AndroidRuntime(4170): at android.view.View$1.onClick(View.java:3818)
05-15 01:39:03.072: E/AndroidRuntime(4170): ... 11 more
05-15 01:39:03.072: E/AndroidRuntime(4170): Caused by: java.lang.NoClassDefFoundError: de.aflx.sardine.SardineFactory
05-15 01:39:03.072: E/AndroidRuntime(4170): at write_helper.WebDavWriter.<init>(WebDavWriter.java:23)
05-15 01:39:03.072: E/AndroidRuntime(4170): at write_helper.WriteCSV.StartToWrite(WriteCSV.java:75)
05-15 01:39:03.072: E/AndroidRuntime(4170): at write_helper.WriteCSV.startToWrite(WriteCSV.java:54)
05-15 01:39:03.072: E/AndroidRuntime(4170): at write_helper.WriteCSV.<init>(WriteCSV.java:28)
05-15 01:39:03.072: E/AndroidRuntime(4170): at utils.SaveAllEntry.startBackupProcess(SaveAllEntry.java:195)
05-15 01:39:03.072: E/AndroidRuntime(4170): at utils.SaveAllEntry.saveToWifi(SaveAllEntry.java:117)
05-15 01:39:03.072: E/AndroidRuntime(4170): ... 14 more
[/code]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you including the Sardine library in the app?
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am following this format.
Project property > Java Build path > Projects
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know whether that means that the library gets included in the app or not. (Actually, I don't know what that means, period. They sound like IDE menus - IDEs I'm familiar with differentiate between build setup and release setup.)
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic