lib/dav4rack/resource.rb in dav4rack-0.1.4 vs lib/dav4rack/resource.rb in dav4rack-0.1.5

- old
+ new

@@ -194,18 +194,18 @@ end # HTTP COPY request. # # Copy this resource to given destination resource. - def copy(dest) + def copy(dest, overwrite=false) raise NotImplementedError end # HTTP MOVE request. # # Move this resource to given destination resource. - def move(dest) + def move(dest, overwrite=false) raise NotImplemented end # args:: Hash of lock arguments # Request for a lock on the given resource. A valid lock should lock @@ -285,11 +285,10 @@ raise BadRequest if token.nil? || token.empty? lock = @lock_class.find_by_token(token) raise Forbidden unless lock && lock.user == @user raise Conflict unless lock.path =~ /^#{Regexp.escape(@path)}.*$/ lock.destroy - delete if name[0,1] == '.' && @options[:delete_dotfiles] NoContent end # Create this resource as collection. @@ -392,9 +391,10 @@ <th class="size">Size</th> <th class="type">Type</th> <th class="mtime">Last Modified</th> </tr> %s </table> <hr /> </body></html>' end # Does client allow GET redirection + # TODO: Get a comprehensive list in here. Especially now that trasmit added support def allows_redirect? %w(cyberduck konqueror).any?{|x| (request.respond_to?(:user_agent) ? request.user_agent.to_s.downcase : request.env['HTTP_USER_AGENT'].to_s.downcase) =~ /#{Regexp.escape(x)}/} end # Returns authentication credentials if available in form of [username,password]