Public method put

Puts a file into a collection.
Data is putted as one chunk!
@param string path, string data
@return int status-code read from webdavserver. False on error.
773619
function put($path, $data ) {
        $this->_path = $this->translate_uri($path);
        $this->header_unset();
        $this->create_basic_request('PUT');
        // add more needed header information ...
        $this->header_add('Content-length: ' . strlen($data));
        $this->header_add('Content-type: application/octet-stream');
        // send header
        $this->send_request();
        // send the rest (data)
        fputs($this->sock, $data);
        $this->get_respond();
        $response = $this->process_respond();

        // validate the response
        // check http-version
        if ($response['status']['http-version'] == 'HTTP/1.1' ||
            $response['status']['http-version'] == 'HTTP/1.0') {
                // seems to be http ... proceed
                // We expect a 200 or 204 status code
                // see rfc 2068 - 9.6 PUT...
                // print 'http ok<br>';
                return $response['status']['status-code'];
            }
        // ups: no http status was returned ?
        return false;
    }
202232
def put(path, options = {})
      ext = options[:ext] || File.extname(path)
      path = path.to_s
      resp = http_post("/v1/#{appkey}",
                       File.open(path.start_with?('/') ? path : fpath(path)).read,
                       :params => {
                         :suffix => ext,
                         :simple_name => options[:simple_name] || 0
                       },
                       :accept => :json)

      json = JSON.parse(resp)
      json && json['TFS_FILE_NAME']
    end
1341210
def put(path, options={}, raw=false, unformatted=true)
      request(:put, path, options, raw, unformatted)
    end
536469
public void put(String fromPath, String toPath, Status status) {
        http.put(fromPath, redirectRoute(toPath, status));
    }
121301
def put(path, data = {}, header = {})
      _send(json_request(Net::HTTP::Patch, path, data, header))
    end
1128241
def put(self, path, data, **options):
        
        data, options = self._update_request(data, options)
        return self.request('put', path, data=data, **options)
309946
public BinaryUploadRequest setFileToUpload(String path) throws FileNotFoundException {
        params.files.clear();
        params.files.add(new UploadFile(path));
        return this;
    }
1187853
public void add(final String path) {
        final Set<String> paths = new LinkedHashSet<String>();
        paths.addAll(get());
        paths.add(path);
        set(paths);
    }
1260940
public Javalin put(@NotNull String path, @NotNull Handler handler) {
        return addHandler(HandlerType.PUT, path, handler);
    }
1080632
public Response put(String restPath, Object payload, Map<String, String> queryParams) {
		LOG.debug("PUT: {}", restPath);
		return call(HttpMethod.PUT, restPath, Response.class, payload, queryParams);
	}
1015635
public function post($path, $data)
    {
        if (false === $json = $this->runRequest($path, 'POST', $data)) {
            return false;
        }

        return $this->decode($json);

    }
1246406
public static boolean validatePath(String path) {
        if(path == null) {
            Log.w(TAG, "Uploading path not set");
            return false;
        }

        try {
            uriFromString(path);
            return true;
        } catch(DataSinkException e) {
            return false;
        }
    }
324951
public synchronized void put(String path, long value, String taskId) {
    Point p;
    int last = windowNum - 1;
    if (value == RECOVERY_FAIL) {
      p = new Point(value, path, System.currentTimeMillis(), taskId);
      AtomicInteger counter = failedRecoveredFiles.get(path);
      if (counter == null) {
        counter = new AtomicInteger(0);
        failedRecoveredFiles.put(path, counter);
      }
      if (counter.incrementAndGet() == 1) {
        totalFailedPaths.get(last).incrementAndGet();
      }
    } else {
      value /= dividend;
      p = new Point(value, path, System.currentTimeMillis(), taskId);
      CounterArray counters = histo.get(value);
      if (counters == null) {
        counters = new CounterArray(windowNum);
        histo.put(value, counters);
      }
      counters.incrementAndGet(last);
      totalPoints.incrementAndGet(last);
    }
    points.add(p);
    InjectionHandler.processEvent(InjectionEvent.RAID_SEND_RECOVERY_TIME, this, path, 
        value, taskId);
  }
1059759
def put_file(self, in_path, out_path):

        '''  '''
        vvv("PUT %s TO %s" % (in_path, out_path), host=self.host)

        if not os.path.exists(in_path):
            raise errors.AnsibleFileNotFound("file or module does not exist: %s" % in_path)
        data = file(in_path).read()
        data = base64.b64encode(data)

        data = dict(mode='put', data=data, out_path=out_path)
        # TODO: support chunked file transfer
        data = utils.jsonify(data)
        data = utils.encrypt(self.key, data)
        self.socket.send(data)

        response = self.socket.recv()
        response = utils.decrypt(self.key, response)
        response = utils.parse_json(response)
1104722
function put($path, $body, $contentType = null)
    {
        return $this->dispatchRequest(
            $this->buildRequest('PUT', $path, $body, $contentType)
        );
    }
971443
public JSONObject put(String path, Map<String, Object> params) throws APIError {
        return request(Verb.PUT, path, params);
    }
1228461
public function put($path, $data)
    {
        if (false === $json = $this->runRequest($path, 'PUT', $data)) {
            return false;
        }

        return $this->decode($json);
    }