When I reading sources of gowebdav I found that Client.createParentCollection() method is required in some places, and marked with TODO statements.
So, in this pull request I do:
Add Client.createParentCollection(itemPath string) error method to Client's structure
Use this method inside Client.Write(path string, data []byte, _ os.FileMode) error method in case of 409 response
Use this method inside Client.WriteStream(path string, stream io.Reader, _ os.FileMode) error method
Use this method inside Client.copymove(method string, oldpath string, newpath string, overwrite bool) error method in case of 409 response
NOTE: I think Client.Write() and Client.WriteStream() methods should be refactored to use c.createParentCollection() in the same way, because now Client.WriteStream() method always trying to create parent collection but Client.Write() method trying to create parent collection only in case of 409 error
UPDATE:
Also .travis.yml file was changed to install dependencies before tests running.
When I reading sources of
gowebdav
I found thatClient.createParentCollection()
method is required in some places, and marked withTODO
statements. So, in this pull request I do:Client.createParentCollection(itemPath string) error
method toClient
's structureClient.Write(path string, data []byte, _ os.FileMode) error
method in case of409
responseClient.WriteStream(path string, stream io.Reader, _ os.FileMode) error
methodClient.copymove(method string, oldpath string, newpath string, overwrite bool) error
method in case of409
responseNOTE: I think
Client.Write()
andClient.WriteStream()
methods should be refactored to usec.createParentCollection()
in the same way, because nowClient.WriteStream()
method always trying to create parent collection butClient.Write()
method trying to create parent collection only in case of409
errorUPDATE: Also
.travis.yml
file was changed to install dependencies before tests running.