From 87cd7f63ee08005cd9758fb53a73b546a7186aa6 Mon Sep 17 00:00:00 2001 From: Alexander Heinrich Date: Thu, 16 Feb 2012 08:35:14 +0100 Subject: [PATCH] initial commit --- .classpath | 9 + .gitignore | 3 + .project | 33 + AndroidManifest.xml | 14 + proguard.cfg | 40 + project.properties | 12 + res/drawable-hdpi/ic_launcher.png | Bin 0 -> 4147 bytes res/drawable-ldpi/ic_launcher.png | Bin 0 -> 1723 bytes res/drawable-mdpi/ic_launcher.png | Bin 0 -> 2574 bytes res/layout/main.xml | 12 + res/values/strings.xml | 7 + src/de/aflx/sardine/DavResource.java | 446 +++++++++ src/de/aflx/sardine/Sardine.java | 271 ++++++ src/de/aflx/sardine/SardineFactory.java | 45 + src/de/aflx/sardine/Version.java | 37 + src/de/aflx/sardine/impl/.DS_Store | Bin 0 -> 6148 bytes .../aflx/sardine/impl/SardineException.java | 60 ++ src/de/aflx/sardine/impl/SardineImpl.java | 874 ++++++++++++++++++ src/de/aflx/sardine/impl/handler/.DS_Store | Bin 0 -> 6148 bytes .../impl/handler/ExistsResponseHandler.java | 47 + .../impl/handler/LockResponseHandler.java | 63 ++ .../handler/MultiStatusResponseHandler.java | 80 ++ .../handler/ValidatingResponseHandler.java | 51 + .../impl/handler/VoidResponseHandler.java | 38 + .../sardine/impl/handler/package-info.java | 20 + src/de/aflx/sardine/impl/io/.DS_Store | Bin 0 -> 6148 bytes .../sardine/impl/io/ConsumingInputStream.java | 103 +++ src/de/aflx/sardine/impl/io/package-info.java | 20 + src/de/aflx/sardine/impl/methods/.DS_Store | Bin 0 -> 6148 bytes .../aflx/sardine/impl/methods/HttpCopy.java | 49 + .../aflx/sardine/impl/methods/HttpLock.java | 79 ++ .../aflx/sardine/impl/methods/HttpMkCol.java | 49 + .../aflx/sardine/impl/methods/HttpMove.java | 49 + .../sardine/impl/methods/HttpPropFind.java | 67 ++ .../sardine/impl/methods/HttpPropPatch.java | 49 + .../aflx/sardine/impl/methods/HttpUnlock.java | 60 ++ .../sardine/impl/methods/package-info.java | 20 + src/de/aflx/sardine/impl/package-info.java | 4 + src/de/aflx/sardine/model/.DS_Store | Bin 0 -> 6148 bytes src/de/aflx/sardine/model/Activelock.java | 208 +++++ src/de/aflx/sardine/model/Allprop.java | 39 + src/de/aflx/sardine/model/Collection.java | 38 + src/de/aflx/sardine/model/Creationdate.java | 80 ++ src/de/aflx/sardine/model/Displayname.java | 80 ++ src/de/aflx/sardine/model/Error.java | 71 ++ src/de/aflx/sardine/model/Exclusive.java | 39 + .../sardine/model/Getcontentlanguage.java | 80 ++ .../aflx/sardine/model/Getcontentlength.java | 80 ++ src/de/aflx/sardine/model/Getcontenttype.java | 80 ++ src/de/aflx/sardine/model/Getetag.java | 80 ++ .../aflx/sardine/model/Getlastmodified.java | 77 ++ src/de/aflx/sardine/model/Keepalive.java | 83 ++ src/de/aflx/sardine/model/Link.java | 111 +++ src/de/aflx/sardine/model/Lockdiscovery.java | 79 ++ src/de/aflx/sardine/model/Lockentry.java | 103 +++ src/de/aflx/sardine/model/Lockinfo.java | 126 +++ src/de/aflx/sardine/model/Lockscope.java | 96 ++ src/de/aflx/sardine/model/Locktoken.java | 78 ++ src/de/aflx/sardine/model/Locktype.java | 71 ++ src/de/aflx/sardine/model/Multistatus.java | 111 +++ src/de/aflx/sardine/model/ObjectFactory.java | 408 ++++++++ src/de/aflx/sardine/model/Omit.java | 39 + src/de/aflx/sardine/model/Owner.java | 81 ++ src/de/aflx/sardine/model/Prop.java | 373 ++++++++ .../aflx/sardine/model/Propertybehavior.java | 96 ++ src/de/aflx/sardine/model/Propertyupdate.java | 84 ++ src/de/aflx/sardine/model/Propfind.java | 123 +++ src/de/aflx/sardine/model/Propname.java | 39 + src/de/aflx/sardine/model/Propstat.java | 159 ++++ src/de/aflx/sardine/model/Remove.java | 71 ++ src/de/aflx/sardine/model/Resourcetype.java | 109 +++ src/de/aflx/sardine/model/Response.java | 186 ++++ src/de/aflx/sardine/model/Set.java | 71 ++ src/de/aflx/sardine/model/Shared.java | 39 + src/de/aflx/sardine/model/Source.java | 76 ++ src/de/aflx/sardine/model/Supportedlock.java | 79 ++ src/de/aflx/sardine/model/Write.java | 39 + src/de/aflx/sardine/model/package-info.java | 12 + src/de/aflx/sardine/package-info.java | 20 + src/de/aflx/sardine/util/.DS_Store | Bin 0 -> 6148 bytes src/de/aflx/sardine/util/Logger.java | 9 + src/de/aflx/sardine/util/SardineUtil.java | 370 ++++++++ src/de/aflx/sardine/util/package-info.java | 20 + 83 files changed, 7024 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 AndroidManifest.xml create mode 100644 proguard.cfg create mode 100644 project.properties create mode 100644 res/drawable-hdpi/ic_launcher.png create mode 100644 res/drawable-ldpi/ic_launcher.png create mode 100644 res/drawable-mdpi/ic_launcher.png create mode 100644 res/layout/main.xml create mode 100644 res/values/strings.xml create mode 100644 src/de/aflx/sardine/DavResource.java create mode 100644 src/de/aflx/sardine/Sardine.java create mode 100644 src/de/aflx/sardine/SardineFactory.java create mode 100644 src/de/aflx/sardine/Version.java create mode 100644 src/de/aflx/sardine/impl/.DS_Store create mode 100644 src/de/aflx/sardine/impl/SardineException.java create mode 100644 src/de/aflx/sardine/impl/SardineImpl.java create mode 100644 src/de/aflx/sardine/impl/handler/.DS_Store create mode 100644 src/de/aflx/sardine/impl/handler/ExistsResponseHandler.java create mode 100644 src/de/aflx/sardine/impl/handler/LockResponseHandler.java create mode 100644 src/de/aflx/sardine/impl/handler/MultiStatusResponseHandler.java create mode 100644 src/de/aflx/sardine/impl/handler/ValidatingResponseHandler.java create mode 100644 src/de/aflx/sardine/impl/handler/VoidResponseHandler.java create mode 100644 src/de/aflx/sardine/impl/handler/package-info.java create mode 100644 src/de/aflx/sardine/impl/io/.DS_Store create mode 100644 src/de/aflx/sardine/impl/io/ConsumingInputStream.java create mode 100644 src/de/aflx/sardine/impl/io/package-info.java create mode 100644 src/de/aflx/sardine/impl/methods/.DS_Store create mode 100644 src/de/aflx/sardine/impl/methods/HttpCopy.java create mode 100644 src/de/aflx/sardine/impl/methods/HttpLock.java create mode 100644 src/de/aflx/sardine/impl/methods/HttpMkCol.java create mode 100644 src/de/aflx/sardine/impl/methods/HttpMove.java create mode 100644 src/de/aflx/sardine/impl/methods/HttpPropFind.java create mode 100644 src/de/aflx/sardine/impl/methods/HttpPropPatch.java create mode 100644 src/de/aflx/sardine/impl/methods/HttpUnlock.java create mode 100644 src/de/aflx/sardine/impl/methods/package-info.java create mode 100644 src/de/aflx/sardine/impl/package-info.java create mode 100644 src/de/aflx/sardine/model/.DS_Store create mode 100644 src/de/aflx/sardine/model/Activelock.java create mode 100644 src/de/aflx/sardine/model/Allprop.java create mode 100644 src/de/aflx/sardine/model/Collection.java create mode 100644 src/de/aflx/sardine/model/Creationdate.java create mode 100644 src/de/aflx/sardine/model/Displayname.java create mode 100644 src/de/aflx/sardine/model/Error.java create mode 100644 src/de/aflx/sardine/model/Exclusive.java create mode 100644 src/de/aflx/sardine/model/Getcontentlanguage.java create mode 100644 src/de/aflx/sardine/model/Getcontentlength.java create mode 100644 src/de/aflx/sardine/model/Getcontenttype.java create mode 100644 src/de/aflx/sardine/model/Getetag.java create mode 100644 src/de/aflx/sardine/model/Getlastmodified.java create mode 100644 src/de/aflx/sardine/model/Keepalive.java create mode 100644 src/de/aflx/sardine/model/Link.java create mode 100644 src/de/aflx/sardine/model/Lockdiscovery.java create mode 100644 src/de/aflx/sardine/model/Lockentry.java create mode 100644 src/de/aflx/sardine/model/Lockinfo.java create mode 100644 src/de/aflx/sardine/model/Lockscope.java create mode 100644 src/de/aflx/sardine/model/Locktoken.java create mode 100644 src/de/aflx/sardine/model/Locktype.java create mode 100644 src/de/aflx/sardine/model/Multistatus.java create mode 100644 src/de/aflx/sardine/model/ObjectFactory.java create mode 100644 src/de/aflx/sardine/model/Omit.java create mode 100644 src/de/aflx/sardine/model/Owner.java create mode 100644 src/de/aflx/sardine/model/Prop.java create mode 100644 src/de/aflx/sardine/model/Propertybehavior.java create mode 100644 src/de/aflx/sardine/model/Propertyupdate.java create mode 100644 src/de/aflx/sardine/model/Propfind.java create mode 100644 src/de/aflx/sardine/model/Propname.java create mode 100644 src/de/aflx/sardine/model/Propstat.java create mode 100644 src/de/aflx/sardine/model/Remove.java create mode 100644 src/de/aflx/sardine/model/Resourcetype.java create mode 100644 src/de/aflx/sardine/model/Response.java create mode 100644 src/de/aflx/sardine/model/Set.java create mode 100644 src/de/aflx/sardine/model/Shared.java create mode 100644 src/de/aflx/sardine/model/Source.java create mode 100644 src/de/aflx/sardine/model/Supportedlock.java create mode 100644 src/de/aflx/sardine/model/Write.java create mode 100644 src/de/aflx/sardine/model/package-info.java create mode 100644 src/de/aflx/sardine/package-info.java create mode 100644 src/de/aflx/sardine/util/.DS_Store create mode 100644 src/de/aflx/sardine/util/Logger.java create mode 100644 src/de/aflx/sardine/util/SardineUtil.java create mode 100644 src/de/aflx/sardine/util/package-info.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..96ccc00 --- /dev/null +++ b/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d4610a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/ +gen/ +libs/ diff --git a/.project b/.project new file mode 100644 index 0000000..e01660c --- /dev/null +++ b/.project @@ -0,0 +1,33 @@ + + + Sardine-Android + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..2ffa257 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/proguard.cfg b/proguard.cfg new file mode 100644 index 0000000..b1cdf17 --- /dev/null +++ b/proguard.cfg @@ -0,0 +1,40 @@ +-optimizationpasses 5 +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-dontpreverify +-verbose +-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* + +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference +-keep public class com.android.vending.licensing.ILicensingService + +-keepclasseswithmembernames class * { + native ; +} + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet); +} + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet, int); +} + +-keepclassmembers class * extends android.app.Activity { + public void *(android.view.View); +} + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} diff --git a/project.properties b/project.properties new file mode 100644 index 0000000..a2de03e --- /dev/null +++ b/project.properties @@ -0,0 +1,12 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 +android.library=true diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..8074c4c571b8cd19e27f4ee5545df367420686d7 GIT binary patch literal 4147 zcmV-35X|q1P)OwvMs$Q8_8nISM!^>PxsujeDCl4&hPxrxkp%Qc^^|l zp6LqAcf3zf1H4aA1Gv-O6ha)ktct9Y+VA@N^9i;p0H%6v>ZJZYQ`zEa396z-gi{r_ zDz)D=vgRv62GCVeRjK{15j7V@v6|2nafFX6W7z2j1_T0a zLyT3pGTubf1lB5)32>bl0*BflrA!$|_(WD2)iJIfV}37=ZKAC zSe3boYtQ=;o0i>)RtBvsI#iT{0!oF1VFeW`jDjF2Q4aE?{pGCAd>o8Kg#neIh*AMY zLl{;F!vLiem7s*x0<9FKAd6LoPz3~G32P+F+cuGOJ5gcC@pU_?C2fmix7g2)SUaQO$NS07~H)#fn!Q<}KQWtX}wW`g2>cMld+`7Rxgq zChaey66SG560JhO66zA!;sK1cWa2AG$9k~VQY??6bOmJsw9@3uL*z;WWa7(Nm{^TA zilc?y#N9O3LcTo2c)6d}SQl-v-pE4^#wb=s(RxaE28f3FQW(yp$ulG9{KcQ7r>7mQ zE!HYxUYex~*7IinL+l*>HR*UaD;HkQhkL(5I@UwN%Wz504M^d!ylo>ANvKPF_TvA< zkugG5;F6x}$s~J8cnev->_(Ic7%lGQgUi3n#XVo36lUpcS9s z)ympRr7}@|6WF)Ae;D{owN1;aZSR50al9h~?-WhbtKK%bDd zhML131oi1Bu1&Qb$Cp199LJ#;j5d|FhW8_i4KO1OI>}J^p2DfreMSVGY9aFlr&90t zyI2FvxQiKMFviSQeP$Ixh#70qj5O%I+O_I2t2XHWqmh2!1~tHpN3kA4n=1iHj?`@c<~3q^X6_Q$AqTDjBU`|!y<&lkqL|m5tG(b z8a!z&j^m(|;?SW(l*?tZ*{m2H9d&3jqBtXh>O-5e4Qp-W*a5=2NL&Oi62BUM)>zE3 zbSHb>aU3d@3cGggA`C-PsT9^)oy}%dHCaO~nwOrm5E54=aDg(&HR4S23Oa#-a^=}w%g?ZP-1iq8PSjE8jYaGZu z$I)?YN8he?F9>)2d$G6a*zm0XB*Rf&gZAjq(8l@CUDSY1tB#!i> zW$VfG%#SYSiZ};)>pHA`qlfDTEYQEwN6>NNEp+uxuqx({Fgr zjI@!4xRc?vk^9+~eU|mzH__dCDI=xb{Cd}4bELS9xRaS!*FXMwtMR-RR%SLMh0Cjl zencr8#Su<4(%}$yGVBU-HX{18v=yPH*+%^Vtknc>2A;%-~DrYFx^3XfuVgvZ{#1tA== zm3>IzAM2{3Iv_d1XG{P6^tN3|PkJMnjs&CWN7%7_CmjoVakUhsa&dMv==2~^ri?&x zVdv*rnfVyM+I1^Kg*S=23mR@+0T9BWFZUu~@toA8d)fw6be=`Yb6DSX6D?jB%2YT~ z*aHjtIOozfMhA!Jd*?u5_n!SnX>vX`=Ti-1HA4RiE>eI3vTn zz+>Ccf0HX6Ans-ebOB>RJST-Cyr#4XAk+mAlJgdQnoE{^iIN)OcYFSpgJUmXtl@tT z-^ZuUeSj5hSFrQwqX>~EtZ*{>Gi8Bu9_|o06oNtaXP?E936!a@DsvS*tsB@fa6kEA z5GkjwmH?EgpiG&itsB_Tb1NxtFnvxh_s@9KYX1Sttf?AlI~)z zT=6Y7ulx=}<8Scr_UqU-_z)5gPo%050PsbM*ZLno;_-ow&k?FZJtYmb2hPA$LkP)8 z=^d0Q6PImh6Y|QT?{grxj)S=uBKvY2EQUbm@ns9^yKiP~$DcD)c$5Em`zDSScH%iH zVov&m=cMo`1tYwA=!a}vb_ef_{)Q2?FUqn>BR$6phXQRv^1%=YfyE-F$AR4Q?9D!f zCzB^^#td~4u&l~l#rp2QLfe3+_ub9@+|x+m;=2(sQ`s%gO|j$XBb>A7Q(UydipiMw%igcweV#Cr~SP);q>w`bxts_4} znKHg?X==JDkQl3Y>Ckt%`s{n?Nq-1Fw5~%Mq$CAsi-`yu_bKm zxs#QdE7&vgJD%M84f4SNzSDv)S|V?|$!d5a#lhT5>>YWE4NGqa9-fbmV$=)@k&32kdEYetna>=j@0>V8+wRsL;po!3ivVwh<9tn z2S<1u9DAAQ>x1Sn=fk`)At|quvleV($B|#Kap_lB-F^*yV=wZ{9baUu(uXfokr95^ zA*!*W=5a>$2Ps`-F^+qRQT^{*cN>vipT*4!r#p%{(#I7s z0NN94*q?ib$KJjfDI_sjHNdmEVp5wB&j54O#VoFqBwy)gfA$%)4d_X4q${L9Xom2R3xy&ZBSNgt4a1d7K^CDWa9r zVb-_52m}Vp)`9;ZSKd#|U4ZYj5}Gp49{4utST|=c`~(#>KHF6}CCov1iHYw zt{bWo)A@yF2$~c(nR$rSAaFQ$(Wh{vkG1AlutDMw=mM`C`T=X&|Ad9fb5Od}ROt1z zOpczHqrb4Jo^rSCiW#&o(m7jFamnrsTpQb;*h4o8r#$aZ}2RaT-x2u^^ z%u@YyIv$U^u~@9(XGbSwU@fk6SikH>j+D1jQrYTKGJpW%vUT{!d}7THI5&Sa?~MKy zS0-mvMl+BOcroEJ@hN!2H_?coTEJ5Q<;Nd?yx;eIj4{$$E2?YUO|NtNPJ-PdDf;s} zab;}Mz0kbOI}5*w@3gROcnl#5)wQnEhDBfn!Xhy`u>C}*E~vWpO^HS)FC>8^umI=+ z&H;LW6w#;EF`}vQd_9Muru`KnQVPI9U?(sD)&Dg-0j3#(!fNKVZ_GoYH{la~d*1Yh$TI-TL>mI4vpNb@sU2=IZ8vL%AXUx0 zz{K0|nK(yizLHaeW#ZhRfQXoK^}1$=$#1{Yn002ovPDHLkV1n#w+^+xt literal 0 HcmV?d00001 diff --git a/res/drawable-ldpi/ic_launcher.png b/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..1095584ec21f71cd0afc9e0993aa2209671b590c GIT binary patch literal 1723 zcmV;s21NOZP)AReP91Tc8>~sHP8V>Ys(CF=aT`Sk=;|pS}XrJPb~T1dys{sdO&0YpQBSz*~us zcN*3-J_EnE1cxrXiq*F~jZje~rkAe3vf3>;eR)3?Ox=jK*jEU7Do|T`2NqP{56w(* zBAf)rvPB_7rsfeKd0^!CaR%BHUC$tsP9m8a!i@4&TxxzagzsYHJvblx4rRUu#0Jlz zclZJwdC}7S3BvwaIMTiwb!98zRf|zoya>NudJkDGgEYs=q*HmC)>GExofw=92}s;l z_YgKLUT5`<1RBwq{f)K~I%M=gRE6d)b5BP`8{u9x0-wsG%H)w^ zRU7n9FwtlfsZSjiSB(k8~Y5+O>dyoSI477Ly?|FR?m))C!ci%BtY!2Sst8Uri#|SFX&)8{_Ou2 z9r5p3Vz9_GY#%D>%huqp_>U}K45YGy__TE!HZA@bMxX~@{;>cGYRgH~Ih*vd7EgV7h6Pg$#$lH+5=^lj{W80p{{l+;{7_t5cv3xVUy zl_BY4ht1JH*EEeRS{VwTC(QFIVu8zF&P8O$gJsMgsSO35SVvBrX`Vah$Yz2-5T>-`4DJNH;N zlSSY8-mfty+|1~*;BtTwLz_w5 z+lRv)J28~G%ouyvca(@|{2->WsPii&79&nju7ITE6hMX4AQc{|KqZN#)aAvemg3IZ zCr}Y+!r}JU&^>U1C2WyZC<=47itSYQ`?$5{VH?mtFMFFExfYTsfqK%*WzH@Onc#i` zI@a|rm-WbKk{5my{mF}H>Duc$bit&yLAgFfqo2vVbm~?FeG#0F?dSP*kxSo0Ff!o@ z(C}B;r&6pa-NY4;y~5lX8g&*MYQ>yLGd^tDWC4(sGy$Ow-*!eh%xt;>ve|J1q$*w< zh;B#cz!6l2=5bkX#nJ9PJQ`ew8t>7z$bxqf*QB=l2_UB$hK|1EIfloN-jQ=qcwChF zYAkkyp=;FwcnUB3v0=*tMYMA(HdyQ`Og{P|8RRXpj5bgrSmEzSMfBn+{{vpNxw?;5UX;iv9sYxy_`IQHs$i<61a_iv^L>h8s-`D(`e@|IgS*Fj zNGM876Gf;3D8*1UX9a%v>yJKD*QkCwW2AirU(L{qNA)JghmGItc;(H<$!ABY&gBy1vJIEUj-b8%el*o|VkG)LqNx#TG>Jvj^jIte!!+RY z)T4j$7+PoF1AkRBf}R#^T=-q|PaK1$c<4UH)Hpq3$4WA|xtr!ZQLC=*vNE>O6E9kp+5X0eKB$6>C(lPwI@3#oY zhS_%x7e|j!$yG?ECXmh~EH~^OeuK}+sWoJse3Z3?ha3n`MM9KvA?uqpEnBg4Q46)7 zM$p%a$@l;+O}vfvx%XjH`}a{(-HHth9!JaUwV0*VqGR48^gWNYN<&~7x)y$e!X>e` zZ5!6KZoxbKuV9XUDI%#M1~IVh?pNSdeb~6@$y`v|yk=XK+fHxnDqnUK4&=QRNyIVf zYbDM*cI>~qIy*a7=z7uqkw@agd(<=y-Q7L!ty_23SGdXmahO<;N=wB+j;lNm%=OHC zy zU|>La6h%92y4IPufI$9>Xu!@y`TaNgtg&41@PwMwBdmSm7)xAWDLoqjZ==P2#*k7! z3o1)cVSI3KP_!?d8G^Lg0FtLXC~JYdxi|c%h~lXEixY=%VSFF@!*3&&9>(Rb|iK54Cx5;s~PY5iaV1het%w`dgQFBAJ;aFK zImQC}(|QaCFYUm1JVfzSc)ebv=)ObI)0jwJb``}Zj9J0n0Xgn*Zc(rFM9$xh_makZbm-at_v5^SW zM1y1SW@%+FuIy*WR)i3A2N_q;(YO`O!A|Ts^%z}9ZepCj3ytlw#x%N_fNrKKtPh`< z|1{UqF`4LxHaCQ79+E=uUXCOZ35jAMRz%R%0(P!0FMv=sk>Nr8%+OzY^c-M9@+fz=G`qa@v4sF5u-2289-#$**LWnyNNDwDf1( zkUiMnw|y$tn>pQP=Vn!#|17L^5AGrjtBkN$D@v)Z7LXc5EFhLB4<;7Wehh)CMqX|W zqsiZaO^benJ_hwa&V0ub$-_HUk**?g6fm9|!@kguU6*zhK)$qn-<3*kFrYPIaqR=V zUaUvk>@F_89b@tHs8R!*QKY;INJ<2_U+K6Ca3e9Gsl2{qY0%a7J?uICWgHuLfj+MB z=GkAN1&ifT#2u}B+2S#~$5jA(Qn^;H%CCmIae4AE-Dsng|Hl*Ov!z72k3ZnJs{pp| z+pW`DDueC#mEWOf=ucJ!dTL}hzOeiS-i?m2E;`EKz4<&Lu~NnW?peqVU^@<+T3KKu z{yrI%Qy-Z%HEvLUz}n^~m?7x`xuCtNR#L2En!T>dQtIKdS#V-Hzt3RtwTeYtmQ&dR z6qXZvac*oc@BUYEH%@Ylv_1&tSjkbzzU6*h1(3^C`;1z;g_SmOtclS?KWk2VYE zM*oS<=C483XckW?GN|1jfh3Ro(h + + + + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml new file mode 100644 index 0000000..3412d4a --- /dev/null +++ b/res/values/strings.xml @@ -0,0 +1,7 @@ + + + + Hello World! + Sardine-Android + + \ No newline at end of file diff --git a/src/de/aflx/sardine/DavResource.java b/src/de/aflx/sardine/DavResource.java new file mode 100644 index 0000000..a67aefb --- /dev/null +++ b/src/de/aflx/sardine/DavResource.java @@ -0,0 +1,446 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under the License. + */ + +package de.aflx.sardine; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +import de.aflx.sardine.model.Collection; +import de.aflx.sardine.model.Creationdate; +import de.aflx.sardine.model.Getcontentlength; +import de.aflx.sardine.model.Getcontenttype; +import de.aflx.sardine.model.Getetag; +import de.aflx.sardine.model.Getlastmodified; +import de.aflx.sardine.model.Multistatus; +import de.aflx.sardine.model.Prop; +import de.aflx.sardine.model.Propstat; +import de.aflx.sardine.model.Resourcetype; +import de.aflx.sardine.model.Response; +import de.aflx.sardine.util.Logger; +import de.aflx.sardine.util.SardineUtil; + +/** + * Describes a resource on a remote server. This could be a directory or an actual file. + * + * @author jonstevens + * @version $Id: DavResource.java 307 2011-11-09 10:24:53Z dkocher@sudo.ch $ + */ +public class DavResource +{ + private static Logger log = new Logger(); + + /** + * The default content-type if {@link Getcontenttype} is not set in the {@link Multistatus} response. + */ + public static final String DEFAULT_CONTENT_TYPE = "application/octetstream"; + + /** + * The default content-lenght if {@link Getcontentlength} is not set in the {@link Multistatus} response. + */ + public static final long DEFAULT_CONTENT_LENGTH = -1; + + /** + * content-type for {@link Collection}. + */ + public static final String HTTPD_UNIX_DIRECTORY_CONTENT_TYPE = "httpd/unix-directory"; + + /** + * Path component seperator + */ + private static final String SEPARATOR = "/"; + + private final URI href; + private final Date creation; + private final Date modified; + private final String contentType; + private final String etag; + private final Long contentLength; + private final Map customProps; + + /** + * Represents a webdav response block. + * + * @param href + * URI to the resource as returned from the server + * @throws java.net.URISyntaxException + * If parsing the href from the response element fails + */ + protected DavResource(String href, Date creation, Date modified, String contentType, + Long contentLength, String etag, Map customProps) throws URISyntaxException + { + this.href = new URI(href); + this.creation = creation; + this.modified = modified; + this.contentType = contentType; + this.contentLength = contentLength; + this.etag = etag; + this.customProps = customProps; + } + + /** + * Converts the given {@link Response} to a {@link de.aflx.sardine.DavResource}. + * + * @param response + * The response complex type of the multistatus + * @throws java.net.URISyntaxException + * If parsing the href from the response element fails + */ + public DavResource(Response response) throws URISyntaxException + { + this.href = new URI(response.getHref()); + //this.href = new URI(response.getHref().get(0)); + this.creation = SardineUtil.parseDate(this.getCreationDate(response)); + this.modified = SardineUtil.parseDate(this.getModifiedDate(response)); + this.contentType = this.getContentType(response); + this.contentLength = this.getContentLength(response); + this.etag = this.getEtag(response); + this.customProps = this.getCustomProps(response); + } + + /** + * Retrieves modifieddate from props. If it is not available return null. + * + * @param response + * The response complex type of the multistatus + * @return Null if not found in props + */ + private String getModifiedDate(Response response) + { + Propstat list = response.getPropstat(); + if(list.equals("") || null == list) { + return null; + } + return list.getProp().getGetlastmodified(); + /*if (list.isEmpty()) { + return null; + } + for(Propstat propstat: list) { + Getlastmodified glm = propstat.getProp().getGetlastmodified(); + if ((glm != null) && (glm.getContent().size() == 1)) { + return glm.getContent().get(0); + } + } + return null; */ + } + + /** + * Retrieves creationdate from props. If it is not available return null. + * + * @param response + * The response complex type of the multistatus + * @return Null if not found in props + */ + private String getCreationDate(Response response) + { + Propstat list = response.getPropstat(); + if(list.equals("") || null == list) { + return null; + } + return list.getProp().getCreationdate(); + /*List list = response.getPropstat(); + if (list.isEmpty()) { + return null; + } + for(Propstat propstat: list) { + Creationdate gcd = propstat.getProp().getCreationdate(); + if ((gcd != null) && (gcd.getContent().size() == 1)) + { + return gcd.getContent().get(0); + } + } + return null;*/ + } + + /** + * Retrieves the content-type from prop or set it to {@link #DEFAULT_CONTENT_TYPE}. If isDirectory always set the content-type to + * {@link #HTTPD_UNIX_DIRECTORY_CONTENT_TYPE}. + * + * @param response + * The response complex type of the multistatus + * @return the content type. + */ + private String getContentType(Response response) + { + Propstat list = response.getPropstat(); + if(list.equals("") || null == list) { + return null; + } + + String type = list.getProp().getGetcontenttype(); + + // If there is no content type set in the properties, we will parse the href + if (null == type) { + if (this.getHref().toString().endsWith("/")) { + type = HTTPD_UNIX_DIRECTORY_CONTENT_TYPE; + } else { + type = DEFAULT_CONTENT_TYPE; + } + } + + return type; + /*// Make sure that directories have the correct content type. + List list = response.getPropstat(); + if (list.isEmpty()) { + return null; + } + for(Propstat propstat: list) { + Resourcetype resourcetype = propstat.getProp().getResourcetype(); + if ((resourcetype != null) && (resourcetype.getCollection() != null)) + { + // Need to correct the contentType to identify as a directory. + return HTTPD_UNIX_DIRECTORY_CONTENT_TYPE; + } + else + { + Getcontenttype gtt = propstat.getProp().getGetcontenttype(); + if ((gtt != null) && (gtt.getContent().size() == 1)) + { + return gtt.getContent().get(0); + } + } + } + return DEFAULT_CONTENT_TYPE;*/ + } + + /** + * Retrieves content-length from props. If it is not available return {@link #DEFAULT_CONTENT_LENGTH}. + * + * @param response + * The response complex type of the multistatus + * @return contentlength + */ + private long getContentLength(Response response) + { +// Propstat list = response.getPropstat(); +// if(list.equals("") || null == list) { +// return null; +// } +// Getcontentlength gcl = list.getProp().ge; + + return -1; + /*List list = response.getPropstat(); + if (list.isEmpty()) { + return DEFAULT_CONTENT_LENGTH; + } + for(Propstat propstat: list) { + Getcontentlength gcl = propstat.getProp().getGetcontentlength(); + if ((gcl != null) && (gcl.getContent().size() == 1)) + { + try + { + return Long.parseLong(gcl.getContent().get(0)); + } catch (NumberFormatException e) + { + log.warn(String.format("Failed to parse content length %s", gcl.getContent().get(0))); + } + } + } + return DEFAULT_CONTENT_LENGTH;*/ + } + + /** + * Retrieves content-length from props. If it is not available return {@link #DEFAULT_CONTENT_LENGTH}. + * + * @param response + * The response complex type of the multistatus + * @return contentlength + */ + private String getEtag(Response response) + { + Propstat list = response.getPropstat(); + if(list.equals("") || null == list) { + return null; + } + return list.getProp().getGetetag(); + /*List list = response.getPropstat(); + if (list.isEmpty()) { + return null; + } + for(Propstat propstat: list) { + Getetag etag = propstat.getProp().getGetetag(); + if ((etag != null) && (etag.getContent().size() == 1)) + { + return etag.getContent().get(0); + } + } + return null;*/ + } + + /** + * Creates a simple complex Map from the given custom properties of a response. + * This implementation does take namespaces into account. + * + * @param response + * The response complex type of the multistatus + * @return Custom properties + */ + private Map getCustomProps(Response response) + { + return null; + /*List list = response.getPropstat(); + if (list.isEmpty()) { + return null; + } + Map customPropsMap = new HashMap(); + for(Propstat propstat: list) { + List props = propstat.getProp().getAny(); + for (Element element : props) + { + String namespace = element.getNamespaceURI(); + if (namespace == null) { + customPropsMap.put(new QName(SardineUtil.DEFAULT_NAMESPACE_URI, + element.getLocalName(), + SardineUtil.DEFAULT_NAMESPACE_PREFIX), + element.getTextContent()); + } + else { + if (element.getPrefix() == null) { + customPropsMap.put(new QName(element.getNamespaceURI(), + element.getLocalName()), + element.getTextContent()); + } + else { + customPropsMap.put(new QName(element.getNamespaceURI(), + element.getLocalName(), + element.getPrefix()), + element.getTextContent()); + } + } + + } + } + return customPropsMap;*/ + } + + /** + * @return Timestamp + */ + public Date getCreation() + { + return this.creation; + } + + /** + * @return Timestamp + */ + public Date getModified() + { + return this.modified; + } + + /** + * @return MIME Type + */ + public String getContentType() + { + return this.contentType; + } + + /** + * @return Size + */ + public Long getContentLength() + { + return this.contentLength; + } + + /** + * @return Fingerprint + */ + public String getEtag() + { + return this.etag; + } + + /** + * Implementation assumes that every resource with a content type of httpd/unix-directory is a directory. + * + * @return True if this resource denotes a directory + */ + public boolean isDirectory() + { + return HTTPD_UNIX_DIRECTORY_CONTENT_TYPE.equals(this.contentType); + } + + /** + * @return Additional metadata. This implementation does not take namespaces into account. + */ + public Map getCustomProps() + { + Map local = new HashMap(); + Map properties = this.getCustomPropsNS(); + for(QName key: properties.keySet()) { + local.put(key.getLocalPart(), properties.get(key)); + } + return local; + } + + /** + * @return Additional metadata with namespace informations + */ + public Map getCustomPropsNS() + { + return this.customProps; + } + + /** + * @return URI of the resource. + */ + public URI getHref() + { + return this.href; + } + + /** + * Last path component. + * + * @return The name of the resource URI decoded. An empty string if this resource denotes a directory. + * @see #getHref() + */ + public String getName() + { + String path = this.href.getPath(); + try + { + if (path.endsWith(SEPARATOR)) + { + path = path.substring(0, path.length() - 1); + } + return path.substring(path.lastIndexOf('/') + 1); + } catch (StringIndexOutOfBoundsException e) { + log.warn(String.format("Failed to parse name from path %s", path)); + return null; + } + } + + /** + * @return Path component of the URI of the resource. + * @see #getHref() + */ + public String getPath() + { + return this.href.getPath(); + } + + /** + * @see #getPath() + */ + @Override + public String toString() + { + return this.getPath(); + } +} \ No newline at end of file diff --git a/src/de/aflx/sardine/Sardine.java b/src/de/aflx/sardine/Sardine.java new file mode 100644 index 0000000..0393da3 --- /dev/null +++ b/src/de/aflx/sardine/Sardine.java @@ -0,0 +1,271 @@ +package de.aflx.sardine; + +import javax.xml.namespace.QName; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +/** + * The main interface for Sardine operations. + * + * @author jonstevens + * @version $Id: Sardine.java 313 2011-11-18 22:18:37Z dkocher@sudo.ch $ + */ +public interface Sardine +{ + /** + * Add credentials to any scope. + * + * @param username Use in authentication header credentials + * @param password Use in authentication header credentials + */ + void setCredentials(String username, String password); + + /** + * @param username Use in authentication header credentials + * @param password Use in authentication header credentials + * @param domain NTLM authentication + * @param workstation NTLM authentication + */ + void setCredentials(String username, String password, String domain, String workstation); + + /** + * @see #list(String) + */ + @Deprecated + List getResources(String url) throws IOException; + + /** + * Gets a directory listing using WebDAV PROPFIND. + * + * @param url Path to the resource including protocol and hostname + * @return List of resources for this URI including the parent resource itself + * @throws IOException I/O error or HTTP response validation failure + */ + List list(String url) throws IOException; + + /** + * Gets a directory listing using WebDAV PROPFIND. + * + * @param url Path to the resource including protocol and hostname + * @param depth The depth to look at (use 0 for single ressource, 1 for directory listing) + * @return List of resources for this URI including the parent resource itself + * @throws IOException I/O error or HTTP response validation failure + */ + List list(String url, int depth) throws IOException; + + /** + * @see #patch(String, java.util.Map, java.util.List) + */ + @Deprecated + void setCustomProps(String url, Map addProps, List removeProps) throws IOException; + + /** + * Add custom properties for a url WebDAV PROPPATCH. + * + * @param url Path to the resource including protocol and hostname + * @param addProps Properties to add to resource. If a property already exists then its value is replaced. + * @return The patched resources from the response + * @throws IOException I/O error or HTTP response validation failure + */ + List patch(String url, Map addProps) throws IOException; + + /** + * Add or remove custom properties for a url using WebDAV PROPPATCH. + * + * @param url Path to the resource including protocol and hostname + * @param addProps Properties to add to resource. If a property already exists then its value is replaced. + * @param removeProps Properties to remove from resource. Specifying the removal of a property that does not exist is not an error. + * @return The patched resources from the response + * @throws IOException I/O error or HTTP response validation failure + */ + List patch(String url, Map addProps, List removeProps) throws IOException; + + /** + * Uses HTTP GET to download data from a server. The stream must be closed after reading. + * + * @param url Path to the resource including protocol and hostname + * @return Data stream to read from + * @throws IOException I/O error or HTTP response validation failure + */ + InputStream get(String url) throws IOException; + + /** + * Uses HTTP GET to download data from a server. The stream must be closed after reading. + * + * @param url Path to the resource including protocol and hostname + * @param headers Additional HTTP headers to add to the request + * @return Data stream to read from + * @throws IOException I/O error or HTTP response validation failure + */ + InputStream get(String url, Map headers) throws IOException; + + /** + * Uses HTTP PUT to send data to a server. Repeatable on authentication failure. + * + * @param url Path to the resource including protocol and hostname + * @param data Input source + * @throws IOException I/O error or HTTP response validation failure + */ + void put(String url, byte[] data) throws IOException; + + /** + * Uses PUT to send data to a server. Not repeatable on authentication failure. + * + * @param url Path to the resource including protocol and hostname + * @param dataStream Input source + * @throws IOException I/O error or HTTP response validation failure + */ + void put(String url, InputStream dataStream) throws IOException; + + /** + * Uses PUT to send data to a server with a specific content type + * header. Repeatable on authentication failure. + * + * @param url Path to the resource including protocol and hostname + * @param data Input source + * @param contentType MIME type to add to the HTTP request header + * @throws IOException I/O error or HTTP response validation failure + */ + void put(String url, byte[] data, String contentType) throws IOException; + + /** + * Uses PUT to send data to a server with a specific content + * type header. Not repeatable on authentication failure. + * + * @param url Path to the resource including protocol and hostname + * @param dataStream Input source + * @param contentType MIME type to add to the HTTP request header + * @throws IOException I/O error or HTTP response validation failure + */ + void put(String url, InputStream dataStream, String contentType) throws IOException; + + /** + * Uses PUT to send data to a server with a specific content + * type header. Not repeatable on authentication failure. + * + * @param url Path to the resource including protocol and hostname + * @param dataStream Input source + * @param contentType MIME type to add to the HTTP request header + * @param expectContinue Enable Expect: continue header for PUT requests. + * @throws IOException I/O error or HTTP response validation failure + */ + void put(String url, InputStream dataStream, String contentType, boolean expectContinue) throws IOException; + + /** + * Uses PUT to send data to a server with specific headers. Not repeatable + * on authentication failure. + * + * @param url Path to the resource including protocol and hostname + * @param dataStream Input source + * @param headers Additional HTTP headers to add to the request + * @throws IOException I/O error or HTTP response validation failure + */ + void put(String url, InputStream dataStream, Map headers) throws IOException; + + /** + * Delete a resource using HTTP DELETE at the specified url + * + * @param url Path to the resource including protocol and hostname + * @throws IOException I/O error or HTTP response validation failure + */ + void delete(String url) throws IOException; + + /** + * Uses WebDAV MKCOL to create a directory at the specified url + * + * @param url Path to the resource including protocol and hostname + * @throws IOException I/O error or HTTP response validation failure + */ + void createDirectory(String url) throws IOException; + + /** + * Move a url to from source to destination using WebDAV MOVE. Assumes overwrite. + * + * @param sourceUrl Path to the resource including protocol and hostname + * @param destinationUrl Path to the resource including protocol and hostname + * @throws IOException I/O error or HTTP response validation failure + */ + void move(String sourceUrl, String destinationUrl) throws IOException; + + /** + * Copy a url from source to destination using WebDAV COPY. Assumes overwrite. + * + * @param sourceUrl Path to the resource including protocol and hostname + * @param destinationUrl Path to the resource including protocol and hostname + * @throws IOException I/O error or HTTP response validation failure + */ + void copy(String sourceUrl, String destinationUrl) throws IOException; + + /** + * Performs a HTTP HEAD request to see if a resource exists or not. + * + * @param url Path to the resource including protocol and hostname + * @return Anything outside of the 200-299 response code range returns false. + * @throws IOException I/O error or HTTP response validation failure + */ + boolean exists(String url) throws IOException; + + /** + * Put an exclusive write lock on this resource. A write lock must prevent a principal without + * the lock from successfully executing a PUT, POST, PROPPATCH, LOCK, UNLOCK, MOVE, DELETE, or MKCOL + * on the locked resource. All other current methods, GET in particular, function + * independently of the lock. + *

+ * A WebDAV compliant server is not required to support locking in any form. If the server does support + * locking it may choose to support any combination of exclusive and shared locks for any access types. + * + * @param url Path to the resource including protocol and hostname + * @return The lock token to unlock this resource. A lock token is a type of state token, represented + * as a URI, which identifies a particular lock. A lock token is returned by every successful + * LOCK operation in the lockdiscovery property in the response body, and can also be found through + * lock discovery on a resource. + * @throws IOException I/O error or HTTP response validation failure + */ + String lock(String url) throws IOException; + + /** + * Unlock the resource. + *

+ * A WebDAV compliant server is not required to support locking in any form. If the server does support + * locking it may choose to support any combination of exclusive and shared locks for any access types. + * + * @param url Path to the resource including protocol and hostname + * @param token The lock token to unlock this resource. + * @throws IOException I/O error or HTTP response validation failure + * @see #lock(String) + */ + void unlock(String url, String token) throws IOException; + + /** + * Enables HTTP GZIP compression. If enabled, requests originating from Sardine + * will include "gzip" as an "Accept-Encoding" header. + *

+ * If the server also supports gzip compression, it should serve the + * contents in compressed gzip format and include "gzip" as the + * Content-Encoding. If the content encoding is present, Sardine will + * automatically decompress the files upon reception. + */ + void enableCompression(); + + /** + * Disables support for HTTP compression. + * + * @see Sardine#enableCompression() + */ + void disableCompression(); + + /** + * Send a Basic authentication header with each request even before 401 is returned. + * + * @param hostname The hostname to enable preemptive authentication for. + */ + void enablePreemptiveAuthentication(String hostname); + + /** + * Disable preemptive authentication. + */ + void disablePreemptiveAuthentication(); + +} \ No newline at end of file diff --git a/src/de/aflx/sardine/SardineFactory.java b/src/de/aflx/sardine/SardineFactory.java new file mode 100644 index 0000000..ef0422d --- /dev/null +++ b/src/de/aflx/sardine/SardineFactory.java @@ -0,0 +1,45 @@ +package de.aflx.sardine; + +import de.aflx.sardine.impl.SardineImpl; + +import java.net.ProxySelector; + +/** + * The perfect name for a class. Provides the static methods for working with the Sardine interface. + * + * @author jonstevens + * @version $Id: SardineFactory.java 243 2011-05-24 20:50:34Z dkocher@sudo.ch $ + */ +public class SardineFactory +{ + /** + * Default begin() for when you don't need anything but no authentication + * and default settings for SSL. + */ + public static Sardine begin() + { + return begin(null, null); + } + + /** + * Pass in a HTTP Auth username/password for being used with all + * connections + * + * @param username Use in authentication header credentials + * @param password Use in authentication header credentials + */ + public static Sardine begin(String username, String password) + { + return begin(username, password, null); + } + + /** + * @param username Use in authentication header credentials + * @param password Use in authentication header credentials + * @param proxy Proxy configuration + */ + public static Sardine begin(String username, String password, ProxySelector proxy) + { + return new SardineImpl(username, password, proxy); + } +} \ No newline at end of file diff --git a/src/de/aflx/sardine/Version.java b/src/de/aflx/sardine/Version.java new file mode 100644 index 0000000..208a269 --- /dev/null +++ b/src/de/aflx/sardine/Version.java @@ -0,0 +1,37 @@ +package de.aflx.sardine; + +/** + * Provides version information from the manifest. + * + * @author Jeff Schnitzer + * @version $Id: Version.java 275 2011-06-28 06:07:34Z dkocher@sudo.ch $ + */ +public class Version +{ + /** + * @return The Specification-Version in the JAR manifest. + */ + public static String getSpecification() + { + Package pkg = Version.class.getPackage(); + return (pkg == null) ? null : pkg.getSpecificationVersion(); + } + + /** + * @return The Implementation-Version in the JAR manifest. + */ + public static String getImplementation() + { + Package pkg = Version.class.getPackage(); + return (pkg == null) ? null : pkg.getImplementationVersion(); + } + + /** + * A simple main method that prints the version and exits + */ + public static void main(String[] args) + { + System.out.println("Version: " + getSpecification()); + System.out.println("Implementation: " + getImplementation()); + } +} diff --git a/src/de/aflx/sardine/impl/.DS_Store b/src/de/aflx/sardine/impl/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 getResources(String url) throws IOException { + return this.list(url); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#list(java.lang.String) + */ + public List list(String url) throws IOException { + return this.list(url, 1); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#list(java.lang.String) + */ + public List list(String url, int depth) throws IOException { + log.warn("list"); + HttpPropFind entity = new HttpPropFind(url); + entity.setDepth(Integer.toString(depth)); + Propfind body = new Propfind(); + body.setAllprop(new Allprop()); + // entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8)); + entity.setEntity(new StringEntity(" ", UTF_8)); + Multistatus multistatus = this.execute(entity, + new MultiStatusResponseHandler()); + List responses = multistatus.getResponse(); + log.warn("getResponse"); + List resources = new ArrayList( + responses.size()); + for (Response response : responses) { + log.warn("LLL " + response.getHref()); + try { + resources.add(new DavResource(response)); + } catch (URISyntaxException e) { + log.warn(String.format("Ignore resource with invalid URI %s", + response.getHref())); + } + } + return resources; + } + + public void setCustomProps(String url, Map set, + List remove) throws IOException { + this.patch(url, SardineUtil.toQName(set), SardineUtil.toQName(remove)); + } + + public List patch(String url, Map setProps) + throws IOException { + return this.patch(url, setProps, Collections. emptyList()); + } + + /** + * Creates a {@link de.aflx.sardine.model.Propertyupdate} element + * containing all properties to set from setProps and all properties to + * remove from removeProps. Note this method will use a + * {@link de.aflx.sardine.util.SardineUtil#CUSTOM_NAMESPACE_URI} as + * namespace and + * {@link de.aflx.sardine.util.SardineUtil#CUSTOM_NAMESPACE_PREFIX} + * as prefix. + */ + public List patch(String url, Map setProps, + List removeProps) throws IOException { + /*HttpPropPatch entity = new HttpPropPatch(url); + // Build WebDAV PROPPATCH entity. + Propertyupdate body = new Propertyupdate(); + // Add properties + { + Set set = new Set(); + body.getRemoveOrSet().add(set); + Prop prop = new Prop(); + // Returns a reference to the live list + List any = prop.getAny(); + for (Map.Entry entry : setProps.entrySet()) { + Element element = SardineUtil.createElement(entry.getKey()); + element.setTextContent(entry.getValue()); + any.add(element); + } + set.setProp(prop); + } + // Remove properties + { + Remove remove = new Remove(); + body.getRemoveOrSet().add(remove); + Prop prop = new Prop(); + // Returns a reference to the live list + List any = prop.getAny(); + for (QName entry : removeProps) { + Element element = SardineUtil.createElement(entry); + any.add(element); + } + remove.setProp(prop); + } + // entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8)); +// MS multistatus = this.execute(entity, +// new MultiStatusResponseHandler()); +// List responses = multistatus.getResponse(); + List resources = new ArrayList( + 1); +// for (Response response : responses) { +// try { +// resources.add(new DavResource(response)); +// } catch (URISyntaxException e) { +// log.warn(String.format("Ignore resource with invalid URI %s", +// response.getHref().get(0))); +// } +// } + return resources;*/ + return null; + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#lock(java.lang.String) + */ + public String lock(String url) throws IOException { + HttpLock entity = new HttpLock(url); + Lockinfo body = new Lockinfo(); + Lockscope scopeType = new Lockscope(); + scopeType.setExclusive(new Exclusive()); + body.setLockscope(scopeType); + Locktype lockType = new Locktype(); + lockType.setWrite(new Write()); + body.setLocktype(lockType); + // entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8)); + // Return the lock token + return this.execute(entity, new LockResponseHandler()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#unlock(java.lang.String, + * java.lang.String) + */ + public void unlock(String url, String token) throws IOException { + HttpUnlock entity = new HttpUnlock(url, token); + Lockinfo body = new Lockinfo(); + Lockscope scopeType = new Lockscope(); + scopeType.setExclusive(new Exclusive()); + body.setLockscope(scopeType); + Locktype lockType = new Locktype(); + lockType.setWrite(new Write()); + body.setLocktype(lockType); + this.execute(entity, new VoidResponseHandler()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#get(java.lang.String) + */ + public InputStream get(String url) throws IOException { + return this.get(url, Collections. emptyMap()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#get(java.lang.String, java.util.Map) + */ + public InputStream get(String url, Map headers) + throws IOException { + HttpGet get = new HttpGet(url); + for (String header : headers.keySet()) { + get.addHeader(header, headers.get(header)); + } + // Must use #execute without handler, otherwise the entity is consumed + // already after the handler exits. + HttpResponse response = this.execute(get); + VoidResponseHandler handler = new VoidResponseHandler(); + try { + handler.handleResponse(response); + // Will consume the entity when the stream is closed. + return new ConsumingInputStream(response); + } catch (IOException ex) { + get.abort(); + throw ex; + } + } + + /* + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#put(java.lang.String, byte[]) + */ + public void put(String url, byte[] data) throws IOException { + this.put(url, data, null); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#put(java.lang.String, byte[], + * java.lang.String) + */ + public void put(String url, byte[] data, String contentType) + throws IOException { + ByteArrayEntity entity = new ByteArrayEntity(data); + this.put(url, entity, contentType, true); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#put(java.lang.String, + * java.io.InputStream) + */ + public void put(String url, InputStream dataStream) throws IOException { + this.put(url, dataStream, (String) null); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#put(java.lang.String, + * java.io.InputStream, java.lang.String) + */ + public void put(String url, InputStream dataStream, String contentType) + throws IOException { + this.put(url, dataStream, contentType, true); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#put(java.lang.String, + * java.io.InputStream, java.lang.String, boolean) + */ + public void put(String url, InputStream dataStream, String contentType, + boolean expectContinue) throws IOException { + // A length of -1 means "go until end of stream" + InputStreamEntity entity = new InputStreamEntity(dataStream, -1); + this.put(url, entity, contentType, expectContinue); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#put(java.lang.String, + * java.io.InputStream, java.util.Map) + */ + public void put(String url, InputStream dataStream, + Map headers) throws IOException { + // A length of -1 means "go until end of stream" + InputStreamEntity entity = new InputStreamEntity(dataStream, -1); + this.put(url, entity, headers); + } + + /** + * Upload the entity using PUT + * + * @param url + * Resource + * @param entity + * The entity to read from + * @param contentType + * Content Type header + * @param expectContinue + * Add Expect: continue header + */ + public void put(String url, HttpEntity entity, String contentType, + boolean expectContinue) throws IOException { + Map headers = new HashMap(); + if (contentType != null) { + headers.put("Content-Type", contentType); + } + if (expectContinue) { + headers.put(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE); + } + this.put(url, entity, headers); + } + + /** + * Upload the entity using PUT + * + * @param url + * Resource + * @param entity + * The entity to read from + * @param headers + * Headers to add to request + */ + public void put(String url, HttpEntity entity, Map headers) + throws IOException { + HttpPut put = new HttpPut(url); + put.setEntity(entity); + for (String header : headers.keySet()) { + put.addHeader(header, headers.get(header)); + } + if (!put.containsHeader("Content-Type")) { + put.addHeader("Content-Type", HTTP.DEFAULT_CONTENT_TYPE); + } + try { + this.execute(put, new VoidResponseHandler()); + } catch (HttpResponseException e) { + if (e.getStatusCode() == HttpStatus.SC_EXPECTATION_FAILED) { + // Retry with the Expect header removed + put.removeHeaders(HTTP.EXPECT_DIRECTIVE); + if (entity.isRepeatable()) { + this.execute(put, new VoidResponseHandler()); + return; + } + } + throw e; + } + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#delete(java.lang.String) + */ + public void delete(String url) throws IOException { + HttpDelete delete = new HttpDelete(url); + this.execute(delete, new VoidResponseHandler()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#move(java.lang.String, + * java.lang.String) + */ + public void move(String sourceUrl, String destinationUrl) + throws IOException { + HttpMove move = new HttpMove(sourceUrl, destinationUrl); + this.execute(move, new VoidResponseHandler()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#copy(java.lang.String, + * java.lang.String) + */ + public void copy(String sourceUrl, String destinationUrl) + throws IOException { + HttpCopy copy = new HttpCopy(sourceUrl, destinationUrl); + this.execute(copy, new VoidResponseHandler()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#createDirectory(java.lang.String) + */ + public void createDirectory(String url) throws IOException { + HttpMkCol mkcol = new HttpMkCol(url); + this.execute(mkcol, new VoidResponseHandler()); + } + + /** + * (non-Javadoc) + * + * @see de.aflx.sardine.Sardine#exists(java.lang.String) + */ + public boolean exists(String url) throws IOException { + HttpHead head = new HttpHead(url); + return this.execute(head, new ExistsResponseHandler()); + } + + /** + * Validate the response using the response handler. Aborts the request if + * there is an exception. + * + * @param + * Return type + * @param request + * Request to execute + * @param responseHandler + * Determines the return type. + * @return parsed response + */ + protected T execute(HttpRequestBase request, + ResponseHandler responseHandler) throws IOException { + try { + // Clear circular redirect cache + // this.context.removeAttribute(DefaultRedirectStrategy.REDIRECT_LOCATIONS); + // Execute with response handler + return this.client.execute(request, responseHandler, this.context); + } catch (IOException e) { + request.abort(); + throw e; + } + } + + /** + * No validation of the response. Aborts the request if there is an + * exception. + * + * @param request + * Request to execute + * @return The response to check the reply status code + */ + protected HttpResponse execute(HttpRequestBase request) throws IOException { + try { + // Clear circular redirect cache + // this.context.removeAttribute(DefaultRedirectStrategy.REDIRECT_LOCATIONS); + // Execute with no response handler + return this.client.execute(request, this.context); + } catch (IOException e) { + request.abort(); + throw e; + } + } + + /** + * Creates an AbstractHttpClient with all of the defaults. + */ + protected AbstractHttpClient createDefaultClient(ProxySelector selector) { + SchemeRegistry schemeRegistry = this.createDefaultSchemeRegistry(); + ClientConnectionManager cm = this + .createDefaultConnectionManager(schemeRegistry); + HttpParams params = this.createDefaultHttpParams(); + AbstractHttpClient client = new DefaultHttpClient(cm, params); + client.setRoutePlanner(this.createDefaultRoutePlanner(schemeRegistry, + selector)); + return client; + } + + /** + * Creates default params setting the user agent. + * + * @return Basic HTTP parameters with a custom user agent + */ + protected HttpParams createDefaultHttpParams() { + HttpParams params = new BasicHttpParams(); + HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); + String version = Version.getSpecification(); + if (version == null) { + version = VersionInfo.UNAVAILABLE; + } + HttpProtocolParams.setUserAgent(params, "Sardine/" + version); + // Only selectively enable this for PUT but not all entity enclosing + // methods + HttpProtocolParams.setUseExpectContinue(params, false); + HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); + HttpProtocolParams.setContentCharset(params, + HTTP.DEFAULT_CONTENT_CHARSET); + + HttpConnectionParams.setTcpNoDelay(params, true); + HttpConnectionParams.setSocketBufferSize(params, 8192); + return params; + } + + /** + * Creates a new {@link org.apache.http.conn.scheme.SchemeRegistry} for + * default ports with socket factories. + * + * @return a new {@link org.apache.http.conn.scheme.SchemeRegistry}. + */ + protected SchemeRegistry createDefaultSchemeRegistry() { + SchemeRegistry registry = new SchemeRegistry(); + registry.register(new Scheme("http", this.createDefaultSocketFactory(), + 80)); + registry.register(new Scheme("https", this + .createDefaultSecureSocketFactory(), 443)); + return registry; + } + + /** + * @return Default socket factory + */ + protected PlainSocketFactory createDefaultSocketFactory() { + return PlainSocketFactory.getSocketFactory(); + } + + /** + * @return Default SSL socket factory + */ + protected SSLSocketFactory createDefaultSecureSocketFactory() { + return SSLSocketFactory.getSocketFactory(); + } + + /** + * Use fail fast connection manager when connections are not released + * properly. + * + * @param schemeRegistry + * Protocol registry + * @return Default connection manager + */ + protected ClientConnectionManager createDefaultConnectionManager( + SchemeRegistry schemeRegistry) { + return new ThreadSafeClientConnManager(createDefaultHttpParams(), schemeRegistry); + } + + /** + * Override to provide proxy configuration + * + * @param schemeRegistry + * Protocol registry + * @param selector + * Proxy configuration + * @return ProxySelectorRoutePlanner configured with schemeRegistry and + * selector + */ + protected HttpRoutePlanner createDefaultRoutePlanner( + SchemeRegistry schemeRegistry, ProxySelector selector) { + return new ProxySelectorRoutePlanner(schemeRegistry, selector); + } +} \ No newline at end of file diff --git a/src/de/aflx/sardine/impl/handler/.DS_Store b/src/de/aflx/sardine/impl/handler/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 +{ + public Boolean handleResponse(HttpResponse response) throws SardineException + { + StatusLine statusLine = response.getStatusLine(); + int statusCode = statusLine.getStatusCode(); + if (statusCode < HttpStatus.SC_MULTIPLE_CHOICES) + { + return true; + } + if (statusCode == HttpStatus.SC_NOT_FOUND) + { + return false; + } + throw new SardineException("Unexpected response", statusCode, statusLine.getReasonPhrase()); + } +} diff --git a/src/de/aflx/sardine/impl/handler/LockResponseHandler.java b/src/de/aflx/sardine/impl/handler/LockResponseHandler.java new file mode 100644 index 0000000..b23df6e --- /dev/null +++ b/src/de/aflx/sardine/impl/handler/LockResponseHandler.java @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.handler; + +import de.aflx.sardine.impl.SardineException; +import de.aflx.sardine.model.Prop; +import de.aflx.sardine.util.SardineUtil; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.StatusLine; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @version $Id: LockResponseHandler.java 276 2011-06-28 08:13:28Z dkocher@sudo.ch $ + */ +public class LockResponseHandler extends ValidatingResponseHandler +{ + public String handleResponse(HttpResponse response) throws IOException + { + super.validateResponse(response); + + // Process the response from the server. + HttpEntity entity = response.getEntity(); + if (entity == null) + { + StatusLine statusLine = response.getStatusLine(); + throw new SardineException("No entity found in response", statusLine.getStatusCode(), + statusLine.getReasonPhrase()); + } + return this.getToken(entity.getContent()); + } + + /** + * Helper method for getting the Multistatus response processor. + * + * @param stream The input to read the status + * @return Multistatus element parsed from the stream + * @throws java.io.IOException When there is a JAXB error + */ + protected String getToken(InputStream stream) + throws IOException + { + return "XXX"; + //Prop prop = SardineUtil.unmarshal(stream); + //return prop.getLockdiscovery().getActivelock().iterator().next().getLocktoken().getHref().iterator().next(); + } +} diff --git a/src/de/aflx/sardine/impl/handler/MultiStatusResponseHandler.java b/src/de/aflx/sardine/impl/handler/MultiStatusResponseHandler.java new file mode 100644 index 0000000..3cb0502 --- /dev/null +++ b/src/de/aflx/sardine/impl/handler/MultiStatusResponseHandler.java @@ -0,0 +1,80 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.handler; + +import de.aflx.sardine.impl.SardineException; +import de.aflx.sardine.model.Multistatus; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.StatusLine; +import org.simpleframework.xml.Serializer; +import org.simpleframework.xml.core.Persister; + +import java.io.IOException; +import java.io.InputStream; + +/** + * {@link org.apache.http.client.ResponseHandler} which returns the {@link Multistatus} response of + * a {@link de.aflx.sardine.impl.methods.HttpPropFind} request. + * + * @author mirko + * @version $Id: MultiStatusResponseHandler.java 276 2011-06-28 08:13:28Z dkocher@sudo.ch $ + */ +public class MultiStatusResponseHandler extends ValidatingResponseHandler +{ + public Multistatus handleResponse(HttpResponse response) throws SardineException, IOException + { + super.validateResponse(response); + + // Process the response from the server. + HttpEntity entity = response.getEntity(); + StatusLine statusLine = response.getStatusLine(); + if (entity == null) + { + throw new SardineException("No entity found in response", statusLine.getStatusCode(), + statusLine.getReasonPhrase()); + } + return this.getMultistatus(entity.getContent()); + } + + /** + * Helper method for getting the Multistatus response processor. + * + * @param stream The input to read the status + * @return Multistatus element parsed from the stream + * @throws IOException When there is a JAXB error + */ + protected Multistatus getMultistatus(InputStream stream) + throws IOException + { + //return null; + Serializer serializer = new Persister(); + + // deserializer + try { + Multistatus multistatus = serializer.read(Multistatus.class, stream, false); + //Log.i(TAG, "Read multistatus " + multistatus.toString()); + //for (Response res : multistatus.getResponse()) { + //Log.i(TAG, "Response " + res.toString()); + //} + return multistatus; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file diff --git a/src/de/aflx/sardine/impl/handler/ValidatingResponseHandler.java b/src/de/aflx/sardine/impl/handler/ValidatingResponseHandler.java new file mode 100644 index 0000000..506f66a --- /dev/null +++ b/src/de/aflx/sardine/impl/handler/ValidatingResponseHandler.java @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.handler; + +import de.aflx.sardine.impl.SardineException; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.StatusLine; +import org.apache.http.client.ResponseHandler; + +/** + * Basic response handler which takes an url for documentation. + * + * @param return type of {@link ResponseHandler#handleResponse(HttpResponse)}. + * @author mirko + * @version $Id: ValidatingResponseHandler.java 251 2011-05-25 15:29:48Z latchkey $ + */ +public abstract class ValidatingResponseHandler implements ResponseHandler +{ + /** + * Checks the response for a statuscode between {@link HttpStatus#SC_OK} and {@link HttpStatus#SC_MULTIPLE_CHOICES} + * and throws an {@link de.aflx.sardine.impl.SardineException} otherwise. + * + * @param response to check + * @throws SardineException when the status code is not acceptable. + */ + protected void validateResponse(HttpResponse response) throws SardineException + { + StatusLine statusLine = response.getStatusLine(); + int statusCode = statusLine.getStatusCode(); + if (statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES) + { + return; + } + throw new SardineException("Unexpected response", statusLine.getStatusCode(), statusLine.getReasonPhrase()); + } +} \ No newline at end of file diff --git a/src/de/aflx/sardine/impl/handler/VoidResponseHandler.java b/src/de/aflx/sardine/impl/handler/VoidResponseHandler.java new file mode 100644 index 0000000..917c70b --- /dev/null +++ b/src/de/aflx/sardine/impl/handler/VoidResponseHandler.java @@ -0,0 +1,38 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.handler; + +import org.apache.http.HttpResponse; + +import java.io.IOException; + +/** + * {@link org.apache.http.client.ResponseHandler} which just executes the request and checks the answer is + * in the valid range of {@link ValidatingResponseHandler#validateResponse(org.apache.http.HttpResponse)}. + * + * @author mirko + * @version $Id: VoidResponseHandler.java 233 2011-05-24 11:55:15Z dkocher@sudo.ch $ + */ +public class VoidResponseHandler extends ValidatingResponseHandler +{ + + public Void handleResponse(HttpResponse response) throws IOException + { + this.validateResponse(response); + return null; + } +} diff --git a/src/de/aflx/sardine/impl/handler/package-info.java b/src/de/aflx/sardine/impl/handler/package-info.java new file mode 100644 index 0000000..b2aaa17 --- /dev/null +++ b/src/de/aflx/sardine/impl/handler/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Response handler with stauts code validation for {@link org.apache.http.client.HttpClient} implementation. + */ +package de.aflx.sardine.impl.handler; diff --git a/src/de/aflx/sardine/impl/io/.DS_Store b/src/de/aflx/sardine/impl/io/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0COPY requests. Assumes Overwrite = T. + * + * @version $Id: HttpCopy.java 287 2011-07-04 05:46:24Z dkocher@sudo.ch $ + */ +public class HttpCopy extends HttpRequestBase +{ + public static final String METHOD_NAME = "COPY"; + + public HttpCopy(URI sourceUrl, URI destinationUrl) + { + this.setHeader("Destination", destinationUrl.toString()); + this.setHeader("Overwrite", "T"); + this.setURI(sourceUrl); + } + + public HttpCopy(String sourceUrl, String destinationUrl) + { + this(URI.create(sourceUrl), URI.create(destinationUrl)); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } +} diff --git a/src/de/aflx/sardine/impl/methods/HttpLock.java b/src/de/aflx/sardine/impl/methods/HttpLock.java new file mode 100644 index 0000000..c995974 --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/HttpLock.java @@ -0,0 +1,79 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.methods; + +import java.net.URI; + +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.protocol.HTTP; + +/** + * @version $Id: HttpLock.java 290 2011-07-04 17:22:05Z latchkey $ + */ +public class HttpLock extends HttpEntityEnclosingRequestBase +{ + public static final String METHOD_NAME = "LOCK"; + + public HttpLock(String url) + { + this(URI.create(url)); + } + + public HttpLock(URI url) + { + this.setURI(url); + this.setHeader("Content-Type", "text/xml" + HTTP.CHARSET_PARAM + HTTP.UTF_8.toLowerCase()); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } + + /** + * The Depth header may be used with the LOCK method. Values other than 0 or infinity must not + * be used with the Depth header on a LOCK method. All resources that support the LOCK + * method must support the Depth header. + *

+ * If no Depth header is submitted on a LOCK request then the request must act as if + * a Depth:infinity had been submitted. + * + * @param depth "0" or "infinity". + */ + public void setDepth(String depth) + { + this.setHeader("Depth", depth); + } + + /** + * Clients may include Timeout headers in their LOCK requests. However, the server is not required to honor + * or even consider these requests. + */ + public void setTimeout(int seconds) + { + this.setHeader("Timeout", "Second-" + seconds); + } + + /** + * Desires an infinite length lock. + */ + public void setInfinite() + { + this.setHeader("Timeout", "Infinite"); + } +} \ No newline at end of file diff --git a/src/de/aflx/sardine/impl/methods/HttpMkCol.java b/src/de/aflx/sardine/impl/methods/HttpMkCol.java new file mode 100644 index 0000000..b262fa8 --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/HttpMkCol.java @@ -0,0 +1,49 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.methods; + +import java.net.URI; + +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.protocol.HTTP; + +/** + * Simple class for making MKCOL requests. + * + * @version $Id: HttpMkCol.java 290 2011-07-04 17:22:05Z latchkey $ + */ +public class HttpMkCol extends HttpEntityEnclosingRequestBase +{ + public static final String METHOD_NAME = "MKCOL"; + + public HttpMkCol(String url) + { + this(URI.create(url)); + } + + public HttpMkCol(URI url) + { + this.setURI(url); + this.setHeader("Content-Type", "text/xml" + HTTP.CHARSET_PARAM + HTTP.UTF_8.toLowerCase()); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } +} diff --git a/src/de/aflx/sardine/impl/methods/HttpMove.java b/src/de/aflx/sardine/impl/methods/HttpMove.java new file mode 100644 index 0000000..215b766 --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/HttpMove.java @@ -0,0 +1,49 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.methods; + +import org.apache.http.client.methods.HttpRequestBase; + +import java.net.URI; + +/** + * Simple class for making WebDAV MOVE requests. + * + * @version $Id: HttpMove.java 287 2011-07-04 05:46:24Z dkocher@sudo.ch $ + */ +public class HttpMove extends HttpRequestBase +{ + public static final String METHOD_NAME = "MOVE"; + + public HttpMove(URI sourceUrl, URI destinationUrl) + { + this.setHeader("Destination", destinationUrl.toString()); + this.setHeader("Overwrite", "T"); + this.setURI(sourceUrl); + } + + public HttpMove(String sourceUrl, String destinationUrl) + { + this(URI.create(sourceUrl), URI.create(destinationUrl)); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } +} diff --git a/src/de/aflx/sardine/impl/methods/HttpPropFind.java b/src/de/aflx/sardine/impl/methods/HttpPropFind.java new file mode 100644 index 0000000..a0fcc0d --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/HttpPropFind.java @@ -0,0 +1,67 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.methods; + +import java.net.URI; + +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.protocol.HTTP; + +/** + * Simple class for making WebDAV PROPFIND requests. + * + * @version $Id: HttpPropFind.java 290 2011-07-04 17:22:05Z latchkey $ + */ +public class HttpPropFind extends HttpEntityEnclosingRequestBase +{ + public static final String METHOD_NAME = "PROPFIND"; + + public HttpPropFind(final String uri) + { + this(URI.create(uri)); + } + + /** + * Sets the Depth request header to 1, meaning the + * request applies to the resource and its children. + * + * @param uri The resource + */ + public HttpPropFind(final URI uri) + { + this.setDepth(String.valueOf("1")); + this.setURI(uri); + this.setHeader("Content-Type", "text/xml" + HTTP.CHARSET_PARAM + HTTP.UTF_8.toLowerCase()); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } + + /** + * A client may submit a Depth header with a value of "0", "1", or "infinity" with + * a {@link de.aflx.sardine.model.Propfind} on a collection resource with internal member URIs. + * + * @param depth "0", "1" or "infinity". + */ + public void setDepth(String depth) + { + this.setHeader("Depth", depth); + } +} diff --git a/src/de/aflx/sardine/impl/methods/HttpPropPatch.java b/src/de/aflx/sardine/impl/methods/HttpPropPatch.java new file mode 100644 index 0000000..bada38f --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/HttpPropPatch.java @@ -0,0 +1,49 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.methods; + +import java.net.URI; + +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.protocol.HTTP; + +/** + * Simple class for making WebDAV PROPPATCH requests. + * + * @version $Id: HttpPropPatch.java 290 2011-07-04 17:22:05Z latchkey $ + */ +public class HttpPropPatch extends HttpEntityEnclosingRequestBase +{ + public static final String METHOD_NAME = "PROPPATCH"; + + public HttpPropPatch(String url) + { + this(URI.create(url)); + } + + public HttpPropPatch(URI url) + { + this.setURI(url); + this.setHeader("Content-Type", "text/xml" + HTTP.CHARSET_PARAM + HTTP.UTF_8.toLowerCase()); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } +} diff --git a/src/de/aflx/sardine/impl/methods/HttpUnlock.java b/src/de/aflx/sardine/impl/methods/HttpUnlock.java new file mode 100644 index 0000000..1520680 --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/HttpUnlock.java @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.aflx.sardine.impl.methods; + +import java.net.URI; + +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.protocol.HTTP; + +/** + * @version $Id: HttpUnlock.java 290 2011-07-04 17:22:05Z latchkey $ + */ +public class HttpUnlock extends HttpRequestBase +{ + public static final String METHOD_NAME = "UNLOCK"; + + /** + * @param url The resource + * @param token The Lock-Token request header is used with the UNLOCK method to identify the lock to be removed. + * The lock token in the Lock-Token request header must identify a lock that contains the resource + * identified by Request-URI as a member. + */ + public HttpUnlock(String url, String token) + { + this(URI.create(url), token); + } + + /** + * @param url The resource + * @param token The Lock-Token request header is used with the UNLOCK method to identify the lock to be removed. + * The lock token in the Lock-Token request header must identify a lock that contains the resource + * identified by Request-URI as a member. + */ + public HttpUnlock(URI url, String token) + { + this.setURI(url); + this.setHeader("Content-Type", "text/xml" + HTTP.CHARSET_PARAM + HTTP.UTF_8.toLowerCase()); + this.setHeader("Lock-Token", "<" + token + ">"); + } + + @Override + public String getMethod() + { + return METHOD_NAME; + } +} diff --git a/src/de/aflx/sardine/impl/methods/package-info.java b/src/de/aflx/sardine/impl/methods/package-info.java new file mode 100644 index 0000000..b7e44a5 --- /dev/null +++ b/src/de/aflx/sardine/impl/methods/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * WebDAV methods for {@link org.apache.http.client.HttpClient} implementation. + */ +package de.aflx.sardine.impl.methods; diff --git a/src/de/aflx/sardine/impl/package-info.java b/src/de/aflx/sardine/impl/package-info.java new file mode 100644 index 0000000..b165d24 --- /dev/null +++ b/src/de/aflx/sardine/impl/package-info.java @@ -0,0 +1,4 @@ +/** + * Assembles classes only related to the {@link org.apache.http.client.HttpClient} implementation. + */ +package de.aflx.sardine.impl; diff --git a/src/de/aflx/sardine/model/.DS_Store b/src/de/aflx/sardine/model/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}lockscope"/>
+ *         <element ref="{DAV:}locktype"/>
+ *         <element ref="{DAV:}depth"/>
+ *         <element ref="{DAV:}owner" minOccurs="0"/>
+ *         <element ref="{DAV:}timeout" minOccurs="0"/>
+ *         <element ref="{DAV:}locktoken" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "lockscope", +// "locktype", +// "depth", +// "owner", +// "timeout", +// "locktoken" +//}) +//@XmlRootElement(name = "activelock") +public class Activelock { + +// @XmlElement(required = true) + protected Lockscope lockscope; +// @XmlElement(required = true) + protected Locktype locktype; +// @XmlElement(required = true) + protected String depth; + protected Owner owner; + protected String timeout; + protected Locktoken locktoken; + + /** + * Gets the value of the lockscope property. + * + * @return + * possible object is + * {@link Lockscope } + * + */ + public Lockscope getLockscope() { + return lockscope; + } + + /** + * Sets the value of the lockscope property. + * + * @param value + * allowed object is + * {@link Lockscope } + * + */ + public void setLockscope(Lockscope value) { + this.lockscope = value; + } + + /** + * Gets the value of the locktype property. + * + * @return + * possible object is + * {@link Locktype } + * + */ + public Locktype getLocktype() { + return locktype; + } + + /** + * Sets the value of the locktype property. + * + * @param value + * allowed object is + * {@link Locktype } + * + */ + public void setLocktype(Locktype value) { + this.locktype = value; + } + + /** + * Gets the value of the depth property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDepth() { + return depth; + } + + /** + * Sets the value of the depth property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDepth(String value) { + this.depth = value; + } + + /** + * Gets the value of the owner property. + * + * @return + * possible object is + * {@link Owner } + * + */ + public Owner getOwner() { + return owner; + } + + /** + * Sets the value of the owner property. + * + * @param value + * allowed object is + * {@link Owner } + * + */ + public void setOwner(Owner value) { + this.owner = value; + } + + /** + * Gets the value of the timeout property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTimeout() { + return timeout; + } + + /** + * Sets the value of the timeout property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTimeout(String value) { + this.timeout = value; + } + + /** + * Gets the value of the locktoken property. + * + * @return + * possible object is + * {@link Locktoken } + * + */ + public Locktoken getLocktoken() { + return locktoken; + } + + /** + * Sets the value of the locktoken property. + * + * @param value + * allowed object is + * {@link Locktoken } + * + */ + public void setLocktoken(Locktoken value) { + this.locktoken = value; + } + +} diff --git a/src/de/aflx/sardine/model/Allprop.java b/src/de/aflx/sardine/model/Allprop.java new file mode 100644 index 0000000..1c3cc7e --- /dev/null +++ b/src/de/aflx/sardine/model/Allprop.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "allprop") +public class Allprop { + + +} diff --git a/src/de/aflx/sardine/model/Collection.java b/src/de/aflx/sardine/model/Collection.java new file mode 100644 index 0000000..3f1d5af --- /dev/null +++ b/src/de/aflx/sardine/model/Collection.java @@ -0,0 +1,38 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "collection") +public class Collection { + +} diff --git a/src/de/aflx/sardine/model/Creationdate.java b/src/de/aflx/sardine/model/Creationdate.java new file mode 100644 index 0000000..fbaba8b --- /dev/null +++ b/src/de/aflx/sardine/model/Creationdate.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "creationdate") +public class Creationdate { + +// @XmlMixed + @ElementList + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Displayname.java b/src/de/aflx/sardine/model/Displayname.java new file mode 100644 index 0000000..3bd13bf --- /dev/null +++ b/src/de/aflx/sardine/model/Displayname.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; + +import org.simpleframework.xml.ElementList; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "displayname") +public class Displayname { + +// @XmlMixed + @ElementList + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Error.java b/src/de/aflx/sardine/model/Error.java new file mode 100644 index 0000000..b892903 --- /dev/null +++ b/src/de/aflx/sardine/model/Error.java @@ -0,0 +1,71 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlAnyElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "any" +//}) +//@XmlRootElement(name = "error") +public class Error { + +// @XmlAnyElement(lax = true) + protected Object any; + + /** + * Gets the value of the any property. + * + * @return + * possible object is + * {@link Object } + * + */ + public Object getAny() { + return any; + } + + /** + * Sets the value of the any property. + * + * @param value + * allowed object is + * {@link Object } + * + */ + public void setAny(Object value) { + this.any = value; + } + +} diff --git a/src/de/aflx/sardine/model/Exclusive.java b/src/de/aflx/sardine/model/Exclusive.java new file mode 100644 index 0000000..b3db783 --- /dev/null +++ b/src/de/aflx/sardine/model/Exclusive.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "exclusive") +public class Exclusive { + + +} diff --git a/src/de/aflx/sardine/model/Getcontentlanguage.java b/src/de/aflx/sardine/model/Getcontentlanguage.java new file mode 100644 index 0000000..1bdb9c7 --- /dev/null +++ b/src/de/aflx/sardine/model/Getcontentlanguage.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "getcontentlanguage") +public class Getcontentlanguage { + +// @XmlMixed + @ElementList + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Getcontentlength.java b/src/de/aflx/sardine/model/Getcontentlength.java new file mode 100644 index 0000000..328984e --- /dev/null +++ b/src/de/aflx/sardine/model/Getcontentlength.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "getcontentlength") +public class Getcontentlength { + +// @XmlMixed + @ElementList + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Getcontenttype.java b/src/de/aflx/sardine/model/Getcontenttype.java new file mode 100644 index 0000000..36af17d --- /dev/null +++ b/src/de/aflx/sardine/model/Getcontenttype.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; + +import org.simpleframework.xml.ElementList; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "getcontenttype") +public class Getcontenttype { + +// @XmlMixed + @ElementList + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Getetag.java b/src/de/aflx/sardine/model/Getetag.java new file mode 100644 index 0000000..16b0847 --- /dev/null +++ b/src/de/aflx/sardine/model/Getetag.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "getetag") +public class Getetag { + +// @XmlMixed + @ElementList + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Getlastmodified.java b/src/de/aflx/sardine/model/Getlastmodified.java new file mode 100644 index 0000000..feecf80 --- /dev/null +++ b/src/de/aflx/sardine/model/Getlastmodified.java @@ -0,0 +1,77 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "getlastmodified") +public class Getlastmodified { + +// @XmlMixed + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Keepalive.java b/src/de/aflx/sardine/model/Keepalive.java new file mode 100644 index 0000000..3be9f79 --- /dev/null +++ b/src/de/aflx/sardine/model/Keepalive.java @@ -0,0 +1,83 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.JAXBElement; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElementRef; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}href" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "keepalive") +public class Keepalive { + +// @XmlElementRef(name = "href", namespace = "DAV:", type = JAXBElement.class) +// @XmlMixed + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link String }{@code >} + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Link.java b/src/de/aflx/sardine/model/Link.java new file mode 100644 index 0000000..496f559 --- /dev/null +++ b/src/de/aflx/sardine/model/Link.java @@ -0,0 +1,111 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}src" maxOccurs="unbounded"/>
+ *         <element ref="{DAV:}dst" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "src", +// "dst" +//}) +//@XmlRootElement(name = "link") +public class Link { + +// @XmlElement(required = true) + protected List src; +// @XmlElement(required = true) + protected List dst; + + /** + * Gets the value of the src property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the src property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getSrc().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getSrc() { + if (src == null) { + src = new ArrayList(); + } + return this.src; + } + + /** + * Gets the value of the dst property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the dst property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getDst().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getDst() { + if (dst == null) { + dst = new ArrayList(); + } + return this.dst; + } + +} diff --git a/src/de/aflx/sardine/model/Lockdiscovery.java b/src/de/aflx/sardine/model/Lockdiscovery.java new file mode 100644 index 0000000..dd72370 --- /dev/null +++ b/src/de/aflx/sardine/model/Lockdiscovery.java @@ -0,0 +1,79 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <element ref="{DAV:}activelock"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "activelock" +//}) +//@XmlRootElement(name = "lockdiscovery") +public class Lockdiscovery { + + /*@ElementList + protected List activelock; + + *//** + * Gets the value of the activelock property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the activelock property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getActivelock().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Activelock } + * + * + *//* + public List getActivelock() { + if (activelock == null) { + activelock = new ArrayList(); + } + return this.activelock; + }*/ + +} diff --git a/src/de/aflx/sardine/model/Lockentry.java b/src/de/aflx/sardine/model/Lockentry.java new file mode 100644 index 0000000..d015220 --- /dev/null +++ b/src/de/aflx/sardine/model/Lockentry.java @@ -0,0 +1,103 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import org.simpleframework.xml.Element; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}lockscope"/>
+ *         <element ref="{DAV:}locktype"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "lockscope", +// "locktype" +//}) +//@XmlRootElement(name = "lockentry") +public class Lockentry { + +// @XmlElement(required = true) + @Element + protected Lockscope lockscope; +// @XmlElement(required = true) + @Element + protected Locktype locktype; + + /** + * Gets the value of the lockscope property. + * + * @return + * possible object is + * {@link Lockscope } + * + */ + public Lockscope getLockscope() { + return lockscope; + } + + /** + * Sets the value of the lockscope property. + * + * @param value + * allowed object is + * {@link Lockscope } + * + */ + public void setLockscope(Lockscope value) { + this.lockscope = value; + } + + /** + * Gets the value of the locktype property. + * + * @return + * possible object is + * {@link Locktype } + * + */ + public Locktype getLocktype() { + return locktype; + } + + /** + * Sets the value of the locktype property. + * + * @param value + * allowed object is + * {@link Locktype } + * + */ + public void setLocktype(Locktype value) { + this.locktype = value; + } + +} diff --git a/src/de/aflx/sardine/model/Lockinfo.java b/src/de/aflx/sardine/model/Lockinfo.java new file mode 100644 index 0000000..a6bbaae --- /dev/null +++ b/src/de/aflx/sardine/model/Lockinfo.java @@ -0,0 +1,126 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}lockscope"/>
+ *         <element ref="{DAV:}locktype"/>
+ *         <element ref="{DAV:}owner" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "lockscope", +// "locktype", +// "owner" +//}) +//@XmlRootElement(name = "lockinfo") +public class Lockinfo { + +// @XmlElement(required = true) + protected Lockscope lockscope; +// @XmlElement(required = true) + protected Locktype locktype; + protected Owner owner; + + /** + * Gets the value of the lockscope property. + * + * @return + * possible object is + * {@link Lockscope } + * + */ + public Lockscope getLockscope() { + return lockscope; + } + + /** + * Sets the value of the lockscope property. + * + * @param value + * allowed object is + * {@link Lockscope } + * + */ + public void setLockscope(Lockscope value) { + this.lockscope = value; + } + + /** + * Gets the value of the locktype property. + * + * @return + * possible object is + * {@link Locktype } + * + */ + public Locktype getLocktype() { + return locktype; + } + + /** + * Sets the value of the locktype property. + * + * @param value + * allowed object is + * {@link Locktype } + * + */ + public void setLocktype(Locktype value) { + this.locktype = value; + } + + /** + * Gets the value of the owner property. + * + * @return + * possible object is + * {@link Owner } + * + */ + public Owner getOwner() { + return owner; + } + + /** + * Sets the value of the owner property. + * + * @param value + * allowed object is + * {@link Owner } + * + */ + public void setOwner(Owner value) { + this.owner = value; + } + +} diff --git a/src/de/aflx/sardine/model/Lockscope.java b/src/de/aflx/sardine/model/Lockscope.java new file mode 100644 index 0000000..8a57b24 --- /dev/null +++ b/src/de/aflx/sardine/model/Lockscope.java @@ -0,0 +1,96 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <element ref="{DAV:}exclusive"/>
+ *         <element ref="{DAV:}shared"/>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "exclusive", +// "shared" +//}) +//@XmlRootElement(name = "lockscope") +public class Lockscope { + + protected Exclusive exclusive; + protected Shared shared; + + /** + * Gets the value of the exclusive property. + * + * @return + * possible object is + * {@link Exclusive } + * + */ + public Exclusive getExclusive() { + return exclusive; + } + + /** + * Sets the value of the exclusive property. + * + * @param value + * allowed object is + * {@link Exclusive } + * + */ + public void setExclusive(Exclusive value) { + this.exclusive = value; + } + + /** + * Gets the value of the shared property. + * + * @return + * possible object is + * {@link Shared } + * + */ + public Shared getShared() { + return shared; + } + + /** + * Sets the value of the shared property. + * + * @param value + * allowed object is + * {@link Shared } + * + */ + public void setShared(Shared value) { + this.shared = value; + } + +} diff --git a/src/de/aflx/sardine/model/Locktoken.java b/src/de/aflx/sardine/model/Locktoken.java new file mode 100644 index 0000000..9208841 --- /dev/null +++ b/src/de/aflx/sardine/model/Locktoken.java @@ -0,0 +1,78 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}href" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "href" +//}) +//@XmlRootElement(name = "locktoken") +public class Locktoken { + +// @XmlElement(required = true) + protected List href; + + /** + * Gets the value of the href property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the href property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getHref().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getHref() { + if (href == null) { + href = new ArrayList(); + } + return this.href; + } + +} diff --git a/src/de/aflx/sardine/model/Locktype.java b/src/de/aflx/sardine/model/Locktype.java new file mode 100644 index 0000000..1a39aa8 --- /dev/null +++ b/src/de/aflx/sardine/model/Locktype.java @@ -0,0 +1,71 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}write"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "write" +//}) +//@XmlRootElement(name = "locktype") +public class Locktype { + +// @XmlElement(required = true) + protected Write write; + + /** + * Gets the value of the write property. + * + * @return + * possible object is + * {@link Write } + * + */ + public Write getWrite() { + return write; + } + + /** + * Sets the value of the write property. + * + * @param value + * allowed object is + * {@link Write } + * + */ + public void setWrite(Write value) { + this.write = value; + } + +} diff --git a/src/de/aflx/sardine/model/Multistatus.java b/src/de/aflx/sardine/model/Multistatus.java new file mode 100644 index 0000000..03d1d8c --- /dev/null +++ b/src/de/aflx/sardine/model/Multistatus.java @@ -0,0 +1,111 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; + +import org.simpleframework.xml.Element; +import org.simpleframework.xml.ElementList; +import org.simpleframework.xml.Root; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for anonymous complex type. + * + *

+ * The following schema fragment specifies the expected content contained within + * this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}response" maxOccurs="unbounded"/>
+ *         <element ref="{DAV:}responsedescription" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +// @XmlAccessorType(XmlAccessType.FIELD) +// @XmlType(name = "", propOrder = { +// "response", +// "responsedescription" +// }) +// @XmlRootElement(name = "multistatus") +@Root +public class Multistatus { + + @ElementList(inline = true) + protected List response; + @Element(required = false) + protected String responsedescription; + + /** + * Gets the value of the response property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the response property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getResponse().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Response } + * + * + */ + public List getResponse() { + if (response == null) { + response = new ArrayList(); + } + return this.response; + } + + /** + * Gets the value of the responsedescription property. + * + * @return possible object is {@link String } + * + */ + public String getResponsedescription() { + return responsedescription; + } + + /** + * Sets the value of the responsedescription property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setResponsedescription(String value) { + this.responsedescription = value; + } + +} diff --git a/src/de/aflx/sardine/model/ObjectFactory.java b/src/de/aflx/sardine/model/ObjectFactory.java new file mode 100644 index 0000000..7fd5497 --- /dev/null +++ b/src/de/aflx/sardine/model/ObjectFactory.java @@ -0,0 +1,408 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.JAXBElement; +//import javax.xml.bind.annotation.XmlElementDecl; +//import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the de.aflx.sardine.model package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +//@XmlRegistry +public class ObjectFactory { + + private final static QName _Status_QNAME = new QName("DAV:", "status"); + private final static QName _Dst_QNAME = new QName("DAV:", "dst"); + private final static QName _Src_QNAME = new QName("DAV:", "src"); + private final static QName _Timeout_QNAME = new QName("DAV:", "timeout"); + private final static QName _Depth_QNAME = new QName("DAV:", "depth"); + private final static QName _Responsedescription_QNAME = new QName("DAV:", "responsedescription"); + private final static QName _Href_QNAME = new QName("DAV:", "href"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: de.aflx.sardine.model + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Propfind } + * + */ + public Propfind createPropfind() { + return new Propfind(); + } + + /** + * Create an instance of {@link Keepalive } + * + */ + public Keepalive createKeepalive() { + return new Keepalive(); + } + + /** + * Create an instance of {@link Supportedlock } + * + */ + public Supportedlock createSupportedlock() { + return new Supportedlock(); + } + + /** + * Create an instance of {@link Propertyupdate } + * + */ + public Propertyupdate createPropertyupdate() { + return new Propertyupdate(); + } + + /** + * Create an instance of {@link Lockinfo } + * + */ + public Lockinfo createLockinfo() { + return new Lockinfo(); + } + + /** + * Create an instance of {@link Getlastmodified } + * + */ + public Getlastmodified createGetlastmodified() { + return new Getlastmodified(); + } + + /** + * Create an instance of {@link Exclusive } + * + */ + public Exclusive createExclusive() { + return new Exclusive(); + } + + /** + * Create an instance of {@link Getcontentlanguage } + * + */ + public Getcontentlanguage createGetcontentlanguage() { + return new Getcontentlanguage(); + } + + /** + * Create an instance of {@link Locktoken } + * + */ + public Locktoken createLocktoken() { + return new Locktoken(); + } + + /** + * Create an instance of {@link Propertybehavior } + * + */ + public Propertybehavior createPropertybehavior() { + return new Propertybehavior(); + } + + /** + * Create an instance of {@link Propstat } + * + */ + public Propstat createPropstat() { + return new Propstat(); + } + + /** + * Create an instance of {@link Multistatus } + * + */ + public Multistatus createMultistatus() { + return new Multistatus(); + } + + /** + * Create an instance of {@link Prop } + * + */ + public Prop createProp() { + return new Prop(); + } + + /** + * Create an instance of {@link Remove } + * + */ + public Remove createRemove() { + return new Remove(); + } + + /** + * Create an instance of {@link Response } + * + */ + public Response createResponse() { + return new Response(); + } + + /** + * Create an instance of {@link Omit } + * + */ + public Omit createOmit() { + return new Omit(); + } + + /** + * Create an instance of {@link Shared } + * + */ + public Shared createShared() { + return new Shared(); + } + + /** + * Create an instance of {@link Lockentry } + * + */ + public Lockentry createLockentry() { + return new Lockentry(); + } + + /** + * Create an instance of {@link Collection } + * + */ + public Collection createCollection() { + return new Collection(); + } + + /** + * Create an instance of {@link Locktype } + * + */ + public Locktype createLocktype() { + return new Locktype(); + } + + /** + * Create an instance of {@link Error } + * + */ + public Error createError() { + return new Error(); + } + + /** + * Create an instance of {@link Getetag } + * + */ + public Getetag createGetetag() { + return new Getetag(); + } + + /** + * Create an instance of {@link Displayname } + * + */ + public Displayname createDisplayname() { + return new Displayname(); + } + + /** + * Create an instance of {@link Getcontenttype } + * + */ + public Getcontenttype createGetcontenttype() { + return new Getcontenttype(); + } + + /** + * Create an instance of {@link Allprop } + * + */ + public Allprop createAllprop() { + return new Allprop(); + } + + /** + * Create an instance of {@link Link } + * + */ + public Link createLink() { + return new Link(); + } + + /** + * Create an instance of {@link Owner } + * + */ + public Owner createOwner() { + return new Owner(); + } + + /** + * Create an instance of {@link Lockscope } + * + */ + public Lockscope createLockscope() { + return new Lockscope(); + } + + /** + * Create an instance of {@link Set } + * + */ + public Set createSet() { + return new Set(); + } + + /** + * Create an instance of {@link Lockdiscovery } + * + */ + public Lockdiscovery createLockdiscovery() { + return new Lockdiscovery(); + } + + /** + * Create an instance of {@link Write } + * + */ + public Write createWrite() { + return new Write(); + } + + /** + * Create an instance of {@link Source } + * + */ + public Source createSource() { + return new Source(); + } + + /** + * Create an instance of {@link Activelock } + * + */ + public Activelock createActivelock() { + return new Activelock(); + } + + /** + * Create an instance of {@link Propname } + * + */ + public Propname createPropname() { + return new Propname(); + } + + /** + * Create an instance of {@link Resourcetype } + * + */ + public Resourcetype createResourcetype() { + return new Resourcetype(); + } + + /** + * Create an instance of {@link Getcontentlength } + * + */ + public Getcontentlength createGetcontentlength() { + return new Getcontentlength(); + } + + /** + * Create an instance of {@link Creationdate } + * + */ + public Creationdate createCreationdate() { + return new Creationdate(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "status") +// public JAXBElement createStatus(String value) { +// return new JAXBElement(_Status_QNAME, String.class, null, value); +// } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "dst") +// public JAXBElement createDst(String value) { +// return new JAXBElement(_Dst_QNAME, String.class, null, value); +// } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "src") +// public JAXBElement createSrc(String value) { +// return new JAXBElement(_Src_QNAME, String.class, null, value); +// } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "timeout") +// public JAXBElement createTimeout(String value) { +// return new JAXBElement(_Timeout_QNAME, String.class, null, value); +// } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "depth") +// public JAXBElement createDepth(String value) { +// return new JAXBElement(_Depth_QNAME, String.class, null, value); +// } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "responsedescription") +// public JAXBElement createResponsedescription(String value) { +// return new JAXBElement(_Responsedescription_QNAME, String.class, null, value); +// } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ +// @XmlElementDecl(namespace = "DAV:", name = "href") +// public JAXBElement createHref(String value) { +// return new JAXBElement(_Href_QNAME, String.class, null, value); +// } + +} diff --git a/src/de/aflx/sardine/model/Omit.java b/src/de/aflx/sardine/model/Omit.java new file mode 100644 index 0000000..b6777d4 --- /dev/null +++ b/src/de/aflx/sardine/model/Omit.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "omit") +public class Omit { + + +} diff --git a/src/de/aflx/sardine/model/Owner.java b/src/de/aflx/sardine/model/Owner.java new file mode 100644 index 0000000..fd90fe0 --- /dev/null +++ b/src/de/aflx/sardine/model/Owner.java @@ -0,0 +1,81 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlAnyElement; +//import javax.xml.bind.annotation.XmlMixed; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "content" +//}) +//@XmlRootElement(name = "owner") +public class Owner { + +// @XmlMixed +// @XmlAnyElement(lax = true) + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/src/de/aflx/sardine/model/Prop.java b/src/de/aflx/sardine/model/Prop.java new file mode 100644 index 0000000..102e068 --- /dev/null +++ b/src/de/aflx/sardine/model/Prop.java @@ -0,0 +1,373 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlAnyElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +import org.simpleframework.xml.Element; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <all>
+ *         <element ref="{DAV:}creationdate" minOccurs="0"/>
+ *         <element ref="{DAV:}displayname" minOccurs="0"/>
+ *         <element ref="{DAV:}getcontentlanguage" minOccurs="0"/>
+ *         <element ref="{DAV:}getcontentlength" minOccurs="0"/>
+ *         <element ref="{DAV:}getcontenttype" minOccurs="0"/>
+ *         <element ref="{DAV:}getetag" minOccurs="0"/>
+ *         <element ref="{DAV:}getlastmodified" minOccurs="0"/>
+ *         <element ref="{DAV:}lockdiscovery" minOccurs="0"/>
+ *         <element ref="{DAV:}resourcetype" minOccurs="0"/>
+ *         <element ref="{DAV:}supportedlock" minOccurs="0"/>
+ *         <any/>
+ *       </all>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// +//}) +//@XmlRootElement(name = "prop") +public class Prop { + + @Element + private Resourcetype resourcetype; + @Element + private String creationdate; + @Element + private String getlastmodified; + @Element + private String getetag; + @Element (required = false) + private String getcontenttype; + + public Resourcetype getResourcetype() { + return resourcetype; + } + + public String getCreationdate() { + return creationdate; + } + + public String getGetlastmodified() { + return getlastmodified; + } + + public String getGetetag() { + return getetag; + } + + public String getGetcontenttype() { + return getcontenttype; + } + + + /*protected Creationdate creationdate; + protected Displayname displayname; + protected Getcontentlanguage getcontentlanguage; + protected Getcontentlength getcontentlength; + protected Getcontenttype getcontenttype; + protected Getetag getetag; + protected Getlastmodified getlastmodified; + protected Lockdiscovery lockdiscovery; + protected Resourcetype resourcetype; + protected Supportedlock supportedlock;*/ +// @XmlAnyElement + @Element (required = false) + protected List any; + +/* *//** + * Gets the value of the creationdate property. + * + * @return + * possible object is + * {@link Creationdate } + * + *//* + public Creationdate getCreationdate() { + return creationdate; + } + + *//** + * Sets the value of the creationdate property. + * + * @param value + * allowed object is + * {@link Creationdate } + * + *//* + public void setCreationdate(Creationdate value) { + this.creationdate = value; + } + + *//** + * Gets the value of the displayname property. + * + * @return + * possible object is + * {@link Displayname } + * + *//* + public Displayname getDisplayname() { + return displayname; + } + + *//** + * Sets the value of the displayname property. + * + * @param value + * allowed object is + * {@link Displayname } + * + *//* + public void setDisplayname(Displayname value) { + this.displayname = value; + } + + *//** + * Gets the value of the getcontentlanguage property. + * + * @return + * possible object is + * {@link Getcontentlanguage } + * + *//* + public Getcontentlanguage getGetcontentlanguage() { + return getcontentlanguage; + } + + *//** + * Sets the value of the getcontentlanguage property. + * + * @param value + * allowed object is + * {@link Getcontentlanguage } + * + *//* + public void setGetcontentlanguage(Getcontentlanguage value) { + this.getcontentlanguage = value; + } + + *//** + * Gets the value of the getcontentlength property. + * + * @return + * possible object is + * {@link Getcontentlength } + * + *//* + public Getcontentlength getGetcontentlength() { + return getcontentlength; + } + + *//** + * Sets the value of the getcontentlength property. + * + * @param value + * allowed object is + * {@link Getcontentlength } + * + *//* + public void setGetcontentlength(Getcontentlength value) { + this.getcontentlength = value; + } + + *//** + * Gets the value of the getcontenttype property. + * + * @return + * possible object is + * {@link Getcontenttype } + * + *//* + public Getcontenttype getGetcontenttype() { + return getcontenttype; + } + + *//** + * Sets the value of the getcontenttype property. + * + * @param value + * allowed object is + * {@link Getcontenttype } + * + *//* + public void setGetcontenttype(Getcontenttype value) { + this.getcontenttype = value; + } + + *//** + * Gets the value of the getetag property. + * + * @return + * possible object is + * {@link Getetag } + * + *//* + public Getetag getGetetag() { + return getetag; + } + + *//** + * Sets the value of the getetag property. + * + * @param value + * allowed object is + * {@link Getetag } + * + *//* + public void setGetetag(Getetag value) { + this.getetag = value; + } + + *//** + * Gets the value of the getlastmodified property. + * + * @return + * possible object is + * {@link Getlastmodified } + * + *//* + public Getlastmodified getGetlastmodified() { + return getlastmodified; + } + + *//** + * Sets the value of the getlastmodified property. + * + * @param value + * allowed object is + * {@link Getlastmodified } + * + *//* + public void setGetlastmodified(Getlastmodified value) { + this.getlastmodified = value; + } + + *//** + * Gets the value of the lockdiscovery property. + * + * @return + * possible object is + * {@link Lockdiscovery } + * + *//* + public Lockdiscovery getLockdiscovery() { + return lockdiscovery; + } + + *//** + * Sets the value of the lockdiscovery property. + * + * @param value + * allowed object is + * {@link Lockdiscovery } + * + *//* + public void setLockdiscovery(Lockdiscovery value) { + this.lockdiscovery = value; + } + + *//** + * Gets the value of the resourcetype property. + * + * @return + * possible object is + * {@link Resourcetype } + * + *//* + public Resourcetype getResourcetype() { + return resourcetype; + } + + *//** + * Sets the value of the resourcetype property. + * + * @param value + * allowed object is + * {@link Resourcetype } + * + *//* + public void setResourcetype(Resourcetype value) { + this.resourcetype = value; + } + + *//** + * Gets the value of the supportedlock property. + * + * @return + * possible object is + * {@link Supportedlock } + * + *//* + public Supportedlock getSupportedlock() { + return supportedlock; + } + + *//** + * Sets the value of the supportedlock property. + * + * @param value + * allowed object is + * {@link Supportedlock } + * + *//* + public void setSupportedlock(Supportedlock value) { + this.supportedlock = value; + }*/ + + /** + * Gets the value of the any property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the any property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAny().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Element } + * + * + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } + +} diff --git a/src/de/aflx/sardine/model/Propertybehavior.java b/src/de/aflx/sardine/model/Propertybehavior.java new file mode 100644 index 0000000..aa8b057 --- /dev/null +++ b/src/de/aflx/sardine/model/Propertybehavior.java @@ -0,0 +1,96 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <element ref="{DAV:}omit"/>
+ *         <element ref="{DAV:}keepalive"/>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "omit", +// "keepalive" +//}) +//@XmlRootElement(name = "propertybehavior") +public class Propertybehavior { + + protected Omit omit; + protected Keepalive keepalive; + + /** + * Gets the value of the omit property. + * + * @return + * possible object is + * {@link Omit } + * + */ + public Omit getOmit() { + return omit; + } + + /** + * Sets the value of the omit property. + * + * @param value + * allowed object is + * {@link Omit } + * + */ + public void setOmit(Omit value) { + this.omit = value; + } + + /** + * Gets the value of the keepalive property. + * + * @return + * possible object is + * {@link Keepalive } + * + */ + public Keepalive getKeepalive() { + return keepalive; + } + + /** + * Sets the value of the keepalive property. + * + * @param value + * allowed object is + * {@link Keepalive } + * + */ + public void setKeepalive(Keepalive value) { + this.keepalive = value; + } + +} diff --git a/src/de/aflx/sardine/model/Propertyupdate.java b/src/de/aflx/sardine/model/Propertyupdate.java new file mode 100644 index 0000000..b46d187 --- /dev/null +++ b/src/de/aflx/sardine/model/Propertyupdate.java @@ -0,0 +1,84 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlElements; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element ref="{DAV:}remove"/>
+ *         <element ref="{DAV:}set"/>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "removeOrSet" +//}) +//@XmlRootElement(name = "propertyupdate") +public class Propertyupdate { + +// @XmlElements({ +// @XmlElement(name = "remove", type = Remove.class), +// @XmlElement(name = "set", type = Set.class) +// }) + protected List removeOrSet; + + /** + * Gets the value of the removeOrSet property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the removeOrSet property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getRemoveOrSet().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Remove } + * {@link Set } + * + * + */ + public List getRemoveOrSet() { + if (removeOrSet == null) { + removeOrSet = new ArrayList(); + } + return this.removeOrSet; + } + +} diff --git a/src/de/aflx/sardine/model/Propfind.java b/src/de/aflx/sardine/model/Propfind.java new file mode 100644 index 0000000..56f09a4 --- /dev/null +++ b/src/de/aflx/sardine/model/Propfind.java @@ -0,0 +1,123 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <element ref="{DAV:}allprop"/>
+ *         <element ref="{DAV:}propname"/>
+ *         <element ref="{DAV:}prop"/>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "allprop", +// "propname", +// "prop" +//}) +//@XmlRootElement(name = "propfind") +public class Propfind { + + protected Allprop allprop; + protected Propname propname; + protected Prop prop; + + /** + * Gets the value of the allprop property. + * + * @return + * possible object is + * {@link Allprop } + * + */ + public Allprop getAllprop() { + return allprop; + } + + /** + * Sets the value of the allprop property. + * + * @param value + * allowed object is + * {@link Allprop } + * + */ + public void setAllprop(Allprop value) { + this.allprop = value; + } + + /** + * Gets the value of the propname property. + * + * @return + * possible object is + * {@link Propname } + * + */ + public Propname getPropname() { + return propname; + } + + /** + * Sets the value of the propname property. + * + * @param value + * allowed object is + * {@link Propname } + * + */ + public void setPropname(Propname value) { + this.propname = value; + } + + /** + * Gets the value of the prop property. + * + * @return + * possible object is + * {@link Prop } + * + */ + public Prop getProp() { + return prop; + } + + /** + * Sets the value of the prop property. + * + * @param value + * allowed object is + * {@link Prop } + * + */ + public void setProp(Prop value) { + this.prop = value; + } + +} diff --git a/src/de/aflx/sardine/model/Propname.java b/src/de/aflx/sardine/model/Propname.java new file mode 100644 index 0000000..b211648 --- /dev/null +++ b/src/de/aflx/sardine/model/Propname.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "propname") +public class Propname { + + +} diff --git a/src/de/aflx/sardine/model/Propstat.java b/src/de/aflx/sardine/model/Propstat.java new file mode 100644 index 0000000..c158790 --- /dev/null +++ b/src/de/aflx/sardine/model/Propstat.java @@ -0,0 +1,159 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import org.simpleframework.xml.Element; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}prop"/>
+ *         <element ref="{DAV:}status"/>
+ *         <element ref="{DAV:}error" minOccurs="0"/>
+ *         <element ref="{DAV:}responsedescription" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "prop", +// "status", +// "error", +// "responsedescription" +//}) +//@XmlRootElement(name = "propstat") +public class Propstat { + +// @XmlElement(required = true) + @Element + protected Prop prop; +// @XmlElement(required = true) + @Element + protected String status; + @Element (required = false) + protected Error error; + @Element (required = false) + protected String responsedescription; + + /** + * Gets the value of the prop property. + * + * @return + * possible object is + * {@link Prop } + * + */ + public Prop getProp() { + return prop; + } + + /** + * Sets the value of the prop property. + * + * @param value + * allowed object is + * {@link Prop } + * + */ + public void setProp(Prop value) { + this.prop = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + + /** + * Gets the value of the error property. + * + * @return + * possible object is + * {@link Error } + * + */ + public Error getError() { + return error; + } + + /** + * Sets the value of the error property. + * + * @param value + * allowed object is + * {@link Error } + * + */ + public void setError(Error value) { + this.error = value; + } + + /** + * Gets the value of the responsedescription property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getResponsedescription() { + return responsedescription; + } + + /** + * Sets the value of the responsedescription property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setResponsedescription(String value) { + this.responsedescription = value; + } + +} diff --git a/src/de/aflx/sardine/model/Remove.java b/src/de/aflx/sardine/model/Remove.java new file mode 100644 index 0000000..5330e58 --- /dev/null +++ b/src/de/aflx/sardine/model/Remove.java @@ -0,0 +1,71 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}prop"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "prop" +//}) +//@XmlRootElement(name = "remove") +public class Remove { + +// @XmlElement(required = true) + protected Prop prop; + + /** + * Gets the value of the prop property. + * + * @return + * possible object is + * {@link Prop } + * + */ + public Prop getProp() { + return prop; + } + + /** + * Sets the value of the prop property. + * + * @param value + * allowed object is + * {@link Prop } + * + */ + public void setProp(Prop value) { + this.prop = value; + } + +} diff --git a/src/de/aflx/sardine/model/Resourcetype.java b/src/de/aflx/sardine/model/Resourcetype.java new file mode 100644 index 0000000..927c5f2 --- /dev/null +++ b/src/de/aflx/sardine/model/Resourcetype.java @@ -0,0 +1,109 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlAnyElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; +import org.simpleframework.xml.Element; +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}collection" minOccurs="0"/>
+ *         <any/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "collection", +// "any" +//}) +//@XmlRootElement(name = "resourcetype") +public class Resourcetype { + + @Element (required = false) + private Collection collection; +// @XmlAnyElement +// @ElementList +// private List any; + + /** + * Gets the value of the collection property. + * + * @return + * possible object is + * {@link Collection } + * + */ + public Collection getCollection() { + return collection; + } + + /** + * Sets the value of the collection property. + * + * @param value + * allowed object is + * {@link Collection } + * + */ + public void setCollection(Collection value) { + this.collection = value; + } + + /** + * Gets the value of the any property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the any property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAny().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Element } + * + * + */ + /* public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + }*/ + +} diff --git a/src/de/aflx/sardine/model/Response.java b/src/de/aflx/sardine/model/Response.java new file mode 100644 index 0000000..5c50f37 --- /dev/null +++ b/src/de/aflx/sardine/model/Response.java @@ -0,0 +1,186 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; + +import org.simpleframework.xml.Element; + + +/** + *

Java class for anonymous complex type. + *

+ *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}href" maxOccurs="unbounded"/>
+ *         <choice>
+ *           <sequence>
+ *             <element ref="{DAV:}status"/>
+ *           </sequence>
+ *           <sequence>
+ *             <element ref="{DAV:}propstat" maxOccurs="unbounded"/>
+ *           </sequence>
+ *         </choice>
+ *         <element ref="{DAV:}error" minOccurs="0"/>
+ *         <element ref="{DAV:}responsedescription" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "href", +// "status", +// "propstat", +// "error", +// "responsedescription" +//}) +//@XmlRootElement(name = "response") +public class Response { + +// @XmlElement(required = true) + @Element + protected String href; + @Element (required = false) + protected String status; + @Element + protected Propstat propstat; + @Element (required = false) + protected Error error; + @Element (required = false) + protected String responsedescription; + + /** + * Gets the value of the href property. + *

+ *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the href property. + *

+ *

+ * For example, to add a new item, do as follows: + *

+     *    getHref().add(newItem);
+     * 
+ *

+ *

+ *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + */ + public String getHref() { + if(href == null) { + href = new String(); + } + return this.href; + } + + /** + * Gets the value of the status property. + * + * @return possible object is + * {@link String } + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value allowed object is + * {@link String } + */ + public void setStatus(String value) { + this.status = value; + } + + /** + * Gets the value of the propstat property. + *

+ *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the propstat property. + *

+ *

+ * For example, to add a new item, do as follows: + *

+     *    getPropstat().add(newItem);
+     * 
+ *

+ *

+ *

+ * Objects of the following type(s) are allowed in the list + * {@link Propstat } + */ + public Propstat getPropstat() { + if(propstat == null) { + propstat = new Propstat(); + } + return this.propstat; + } + + /** + * Gets the value of the error property. + * + * @return possible object is + * {@link Error } + */ + public Error getError() { + return error; + } + + /** + * Sets the value of the error property. + * + * @param value allowed object is + * {@link Error } + */ + public void setError(Error value) { + this.error = value; + } + + /** + * Gets the value of the responsedescription property. + * + * @return possible object is + * {@link String } + */ + public String getResponsedescription() { + return responsedescription; + } + + /** + * Sets the value of the responsedescription property. + * + * @param value allowed object is + * {@link String } + */ + public void setResponsedescription(String value) { + this.responsedescription = value; + } + +} diff --git a/src/de/aflx/sardine/model/Set.java b/src/de/aflx/sardine/model/Set.java new file mode 100644 index 0000000..facbe6a --- /dev/null +++ b/src/de/aflx/sardine/model/Set.java @@ -0,0 +1,71 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlElement; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{DAV:}prop"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "prop" +//}) +//@XmlRootElement(name = "set") +public class Set { + +// @XmlElement(required = true) + protected Prop prop; + + /** + * Gets the value of the prop property. + * + * @return + * possible object is + * {@link Prop } + * + */ + public Prop getProp() { + return prop; + } + + /** + * Sets the value of the prop property. + * + * @param value + * allowed object is + * {@link Prop } + * + */ + public void setProp(Prop value) { + this.prop = value; + } + +} diff --git a/src/de/aflx/sardine/model/Shared.java b/src/de/aflx/sardine/model/Shared.java new file mode 100644 index 0000000..f7091d6 --- /dev/null +++ b/src/de/aflx/sardine/model/Shared.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "shared") +public class Shared { + + +} diff --git a/src/de/aflx/sardine/model/Source.java b/src/de/aflx/sardine/model/Source.java new file mode 100644 index 0000000..29190c0 --- /dev/null +++ b/src/de/aflx/sardine/model/Source.java @@ -0,0 +1,76 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <element ref="{DAV:}link"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "link" +//}) +//@XmlRootElement(name = "source") +public class Source { + + protected List link; + + /** + * Gets the value of the link property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the link property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getLink().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Link } + * + * + */ + public List getLink() { + if (link == null) { + link = new ArrayList(); + } + return this.link; + } + +} diff --git a/src/de/aflx/sardine/model/Supportedlock.java b/src/de/aflx/sardine/model/Supportedlock.java new file mode 100644 index 0000000..5dcd457 --- /dev/null +++ b/src/de/aflx/sardine/model/Supportedlock.java @@ -0,0 +1,79 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +import java.util.ArrayList; +import java.util.List; +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + +import org.simpleframework.xml.ElementList; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <element ref="{DAV:}lockentry"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "", propOrder = { +// "lockentry" +//}) +//@XmlRootElement(name = "supportedlock") +public class Supportedlock { + + /*@ElementList + protected List lockentry; + + *//** + * Gets the value of the lockentry property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the lockentry property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getLockentry().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Lockentry } + * + * + *//* + public List getLockentry() { + if (lockentry == null) { + lockentry = new ArrayList(); + } + return this.lockentry; + } +*/ +} diff --git a/src/de/aflx/sardine/model/Write.java b/src/de/aflx/sardine/model/Write.java new file mode 100644 index 0000000..14530bb --- /dev/null +++ b/src/de/aflx/sardine/model/Write.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + + +package de.aflx.sardine.model; + +//import javax.xml.bind.annotation.XmlAccessType; +//import javax.xml.bind.annotation.XmlAccessorType; +//import javax.xml.bind.annotation.XmlRootElement; +//import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +//@XmlAccessorType(XmlAccessType.FIELD) +//@XmlType(name = "") +//@XmlRootElement(name = "write") +public class Write { + + +} diff --git a/src/de/aflx/sardine/model/package-info.java b/src/de/aflx/sardine/model/package-info.java new file mode 100644 index 0000000..fd29b40 --- /dev/null +++ b/src/de/aflx/sardine/model/package-info.java @@ -0,0 +1,12 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-10/27/2009 06:09 PM(mockbuild)-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2009.12.23 at 06:27:19 PM PST +// + +/** + * Generated classes from the WebDAV XML schema. + */ +//@javax.xml.bind.annotation.XmlSchema(namespace = "DAV:", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package de.aflx.sardine.model; diff --git a/src/de/aflx/sardine/package-info.java b/src/de/aflx/sardine/package-info.java new file mode 100644 index 0000000..ed6a521 --- /dev/null +++ b/src/de/aflx/sardine/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Base package with factories to work implementation agnostic. + */ +package de.aflx.sardine; diff --git a/src/de/aflx/sardine/util/.DS_Store b/src/de/aflx/sardine/util/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0> DATETIME_FORMATS = Arrays.asList( + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + }, + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + }, + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + }, + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + }, + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + }, + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + }, + new ThreadLocal() + { + @Override + protected SimpleDateFormat initialValue() + { + SimpleDateFormat format = new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US); + format.setTimeZone(TimeZone.getTimeZone("UTC")); + return format; + } + } + ); + + /** + * Loops over all the possible date formats and tries to find the right one. + * + * @param value ISO date string + * @return Null if there is a parsing failure + */ + public static Date parseDate(String value) + { + if (value == null) + { + return null; + } + Date date = null; + for (ThreadLocal format : DATETIME_FORMATS) + { + try + { + date = format.get().parse(value); + break; + } + catch (ParseException e) + { + // We loop through this until we found a valid one. + } + } + return date; + } + +// @SuppressWarnings("unchecked") +// public static T unmarshal(InputStream in) throws IOException +// { +// Unmarshaller unmarshaller = createUnmarshaller(); +// try +// { +// XMLReader reader = XMLReaderFactory.createXMLReader(); +// try +// { +// reader.setFeature( +// "http://xml.org/sax/features/external-general-entities", Boolean.FALSE); +// } +// catch (SAXException e) +// { +// ; //Not all parsers will support this attribute +// } +// try +// { +// reader.setFeature( +// "http://xml.org/sax/features/external-parameter-entities", Boolean.FALSE); +// } +// catch (SAXException e) +// { +// ; //Not all parsers will support this attribute +// } +// try +// { +// reader.setFeature( +// "http://apache.org/xml/features/nonvalidating/load-external-dtd", Boolean.FALSE); +// } +// catch (SAXException e) +// { +// ; //Not all parsers will support this attribute +// } +// try +// { +// reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); +// } +// catch (SAXException e) +// { +// ; //Not all parsers will support this attribute +// } +// return (T) unmarshaller.unmarshal(new SAXSource(reader, new InputSource(in))); +// } +// catch (SAXException e) +// { +// throw new RuntimeException(e.getMessage(), e); +// } +// catch (JAXBException e) +// { +// // Server does not return any valid WebDAV XML that matches our JAXB context +// IOException failure = new IOException("Not a valid DAV response"); +// // Backward compatibility +// failure.initCause(e); +// throw failure; +// } +// } + + /** + * Creates an {@link Unmarshaller} from the {@link SardineUtil#JAXB_CONTEXT}. + * Note: the unmarshaller is not thread safe, so it must be created for every request. + * + * @return A new unmarshaller + * @throws IOException When there is a JAXB error + */ +// private static Unmarshaller createUnmarshaller() +// { +// try +// { +// return JAXB_CONTEXT.createUnmarshaller(); +// } +// catch (JAXBException e) +// { +// throw new RuntimeException(e.getMessage(), e); +// } +// } + + /** + * @return A new marshaller + * @throws IOException When there is a JAXB error + */ +// private static Marshaller createMarshaller() +// { +// try +// { +// return JAXB_CONTEXT.createMarshaller(); +// } +// catch (JAXBException e) +// { +// throw new RuntimeException(e.getMessage(), e); +// } +// } + + /** + * @return New XML document from the default document builder factory. + */ + private static Document createDocument() + { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + try + { + builder = factory.newDocumentBuilder(); + } + catch (ParserConfigurationException e) + { + throw new RuntimeException(e.getMessage(), e); + } + return builder.newDocument(); + } + + /** + * @param jaxbElement An object from the model + * @return The XML string for the WebDAV request + * @throws IOException When there is a JAXB error + */ +// public static String toXml(Object jaxbElement) +// { +// StringWriter writer = new StringWriter(); +// try +// { +// Marshaller marshaller = createMarshaller(); +// marshaller.marshal(jaxbElement, writer); +// } +// catch (JAXBException e) +// { +// throw new RuntimeException(e.getMessage(), e); +// } +// return writer.toString(); +// } + + /** */ + public static Map toQName(Map setProps) + { + if (setProps == null) + { + return Collections.emptyMap(); + } + Map result = new HashMap(setProps.size()); + for (Map.Entry entry : setProps.entrySet()) + { + result.put(createQNameWithCustomNamespace(entry.getKey()), entry.getValue()); + } + return result; + } + + /** */ + public static List toQName(List removeProps) + { + if (removeProps == null) + { + return Collections.emptyList(); + } + List result = new ArrayList(removeProps.size()); + for (String entry : removeProps) + { + result.add(createQNameWithCustomNamespace(entry)); + } + return result; + } + + /** + * @param key Local element name. + */ + public static QName createQNameWithCustomNamespace(String key) + { + return new QName(CUSTOM_NAMESPACE_URI, key, CUSTOM_NAMESPACE_PREFIX); + } + + /** + * @param key Local element name. + */ + public static QName createQNameWithDefaultNamespace(String key) + { + return new QName(DEFAULT_NAMESPACE_URI, key, DEFAULT_NAMESPACE_PREFIX); + } + + /** + * @param key Fully qualified element name. + */ + public static Element createElement(QName key) + { + return createDocument().createElementNS(key.getNamespaceURI(), key.getPrefix() + ":" + key.getLocalPart()); + } +} diff --git a/src/de/aflx/sardine/util/package-info.java b/src/de/aflx/sardine/util/package-info.java new file mode 100644 index 0000000..6592079 --- /dev/null +++ b/src/de/aflx/sardine/util/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2009-2011 Jon Stevens et al. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Utilities to work with XML entities. + */ +package de.aflx.sardine.util;