diff options
author | Ben Smith-Mannschott <bsmith.occs@gmail.com> | 2010-08-23 20:45:00 +0200 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2010-09-03 12:23:36 -0400 |
commit | bf85deddc000469cb2f7af06c2a63d72c1894a00 (patch) | |
tree | 91f8a3f621eac2c9978ad8550a972e6093732961 | |
parent | 5160b58ea1a79e37a5225aea75b0319e561e589b (diff) |
remove deprecated clojure.contrib.http-connection
Signed-off-by: Stuart Sierra <mail@stuartsierra.com>
-rw-r--r-- | modules/complete/pom.xml | 5 | ||||
-rw-r--r-- | modules/http-connection/pom.xml | 21 | ||||
-rw-r--r-- | modules/http-connection/src/main/clojure/clojure/contrib/http/connection.clj | 62 | ||||
-rw-r--r-- | pom.xml | 1 |
4 files changed, 0 insertions, 89 deletions
diff --git a/modules/complete/pom.xml b/modules/complete/pom.xml index be2440dc..0ac8d3d1 100644 --- a/modules/complete/pom.xml +++ b/modules/complete/pom.xml @@ -152,11 +152,6 @@ </dependency> <dependency> <groupId>org.clojure.contrib</groupId> - <artifactId>http-connection</artifactId> - <version>1.3.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.clojure.contrib</groupId> <artifactId>import-static</artifactId> <version>1.3.0-SNAPSHOT</version> </dependency> diff --git a/modules/http-connection/pom.xml b/modules/http-connection/pom.xml deleted file mode 100644 index 74aaa0b0..00000000 --- a/modules/http-connection/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.clojure.contrib</groupId> - <artifactId>parent</artifactId> - <version>1.3.0-SNAPSHOT</version> - <relativePath>../parent</relativePath> - </parent> - <artifactId>http-connection</artifactId> - <dependencies> - <dependency> - <groupId>org.clojure.contrib</groupId> - <artifactId>io</artifactId> - <version>1.3.0-SNAPSHOT</version> - </dependency> - </dependencies> -</project>
\ No newline at end of file diff --git a/modules/http-connection/src/main/clojure/clojure/contrib/http/connection.clj b/modules/http-connection/src/main/clojure/clojure/contrib/http/connection.clj deleted file mode 100644 index c6cf162a..00000000 --- a/modules/http-connection/src/main/clojure/clojure/contrib/http/connection.clj +++ /dev/null @@ -1,62 +0,0 @@ -;;; http/connection.clj: low-level HTTP client API around HttpURLConnection - -;; by Stuart Sierra, http://stuartsierra.com/ -;; June 8, 2009 - -;; Copyright (c) Stuart Sierra, 2009. All rights reserved. The use -;; and distribution terms for this software are covered by the Eclipse -;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) -;; which can be found in the file epl-v10.html at the root of this -;; distribution. By using this software in any fashion, you are -;; agreeing to be bound by the terms of this license. You must not -;; remove this notice, or any other, from this software. - -;; DEPRECATED IN 1.2. Use direct Java bits, or take a look at -;; http://github.com/technomancy/clojure-http-client - -(ns ^{:deprecated "1.2" - :doc "Low-level HTTP client API around HttpURLConnection"} - clojure.contrib.http.connection - (:require [clojure.contrib.io :as duck]) - (:import (java.net URI URL HttpURLConnection) - (java.io File InputStream Reader))) - -(defn http-connection - "Opens an HttpURLConnection at the URL, handled by as-url." - [url] - (.openConnection (duck/as-url url))) - -(defmulti - ^{:doc "Transmits a request entity body."} - send-request-entity (fn [conn entity] (type entity))) - -(defmethod send-request-entity duck/*byte-array-type* [^HttpURLConnection conn entity] - (.setFixedLengthStreamingMode conn (count entity)) - (.connect conn) - (duck/copy entity (.getOutputStream conn))) - -(defmethod send-request-entity String [conn ^String entity] - (send-request-entity conn (.getBytes entity duck/*default-encoding*))) - -(defmethod send-request-entity File [^HttpURLConnection conn ^File entity] - (.setFixedLengthStreamingMode conn (.length entity)) - (.connect conn) - (duck/copy entity (.getOutputStream conn))) - -(defmethod send-request-entity InputStream [^HttpURLConnection conn entity] - (.setChunkedStreamingMode conn -1) - (.connect conn) - (duck/copy entity (.getOutputStream conn))) - -(defmethod send-request-entity Reader [^HttpURLConnection conn entity] - (.setChunkedStreamingMode conn -1) - (.connect conn) - (duck/copy entity (.getOutputStream conn))) - -(defn start-http-connection - ([^HttpURLConnection conn] (.connect conn)) - ([^HttpURLConnection conn request-entity-body] - (if request-entity-body - (do (.setDoOutput conn true) - (send-request-entity conn request-entity-body)) - (.connect conn)))) @@ -45,7 +45,6 @@ <module>modules/generic</module> <module>modules/graph</module> <module>modules/greatest-least</module> - <module>modules/http-connection</module> <module>modules/import-static</module> <module>modules/io</module> <module>modules/jar</module> |