// purgeCheck removes the root directory, if check is set then it
// refuses to do so if it has anything in
purgeCheck removes the root directory, if check is set then it
refuses to do so if it has anything in
// purgeCheck removes the root directory if check is set then it // refuses to do so if it has anything in
func (f *Fs) purgeCheck(dir string, check bool) error {
	if check {
		notEmpty, err := f.dirNotEmpty(dir)
		if err != nil {
			return err
		}
		if notEmpty {
			return fs.ErrorDirectoryNotEmpty
		}
	}
	opts := rest.Opts{
		Method:     "DELETE",
		Path:       f.dirPath(dir),
		NoResponse: true,
	}
	var resp *http.Response
	var err error
	err = f.pacer.Call(func() (bool, error) {
		resp, err = f.srv.CallXML(&opts, nil, nil)
		return shouldRetry(resp, err)
	})
	if err != nil {
		return errors.Wrap(err, "rmdir failed")
	}
	return nil
}
func ( f * Fs ) purgeCheck ( dir string , check bool ) error { if check { notEmpty , err := f . dirNotEmpty ( dir ) if err != nil { return err } if notEmpty { return fs . ErrorDirectoryNotEmpty } } opts := rest . Opts { Method : " " , Path : f . dirPath ( dir ) , NoResponse : true , } var resp * http . Response var err error err = f . pacer . Call ( func ( ) ( bool , error ) { resp , err = f . srv . CallXML ( & opts , nil , nil ) return shouldRetry ( resp , err ) } ) if err != nil { return errors . Wrap ( err , " " ) } return nil }
purgeCheck removes the root directory, if check is set then it
refuses to do so if it has anything in
purgeCheck removes the root directory if check is set then it refuses to do so if it has anything in
// FIXME parse Multistatus response