Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
workingDog committed Dec 5, 2017
1 parent 65d8cba commit 20d341e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-ws-standalone-json" % "1.1.3",
"com.typesafe.play" %% "play-json" % "2.6.7",
"com.github.workingDog" %% "scalastix" % "0.6-SNAPSHOT",
// "ch.qos.logback" % "logback-classic" % "1.2.3",
// "com.typesafe.scala-logging" %% "scala-logging" % "3.7.2"
// "ch.qos.logback" % "logback-classic" % "1.2.3",
// "com.typesafe.scala-logging" %% "scala-logging" % "3.7.2"
"org.slf4j" % "slf4j-nop" % "1.7.25"
)

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/taxii/Collection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ case class Collection(taxiiCollection: TaxiiCollection, api_root: String,
def addObjects(bundle: Bundle): Future[Option[TaxiiStatus]] =
conn.post(thePath, Json.toJson[Bundle](bundle)).map(_.toOption)

def getManifest(filter: Option[Seq[(String, String)]] = None, range: String = ""): Future[Option[TaxiiManifest]] = {
def getManifests(filter: Option[Seq[(String, String)]] = None, range: String = ""): Future[Option[TaxiiManifest]] = {
val thePath = basePath + "/manifest/"
val theHeader = if (range == null || range.isEmpty) conn.getHeaders
else (conn.getHeaders.toMap + ("Range" -> ("items=" + range))).toSeq
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/taxii/TaxiiConnection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ case class TaxiiConnection(host: String,

import TaxiiConnection._

// private val logger = Logger(classOf[TaxiiConnection])
// private val logger = Logger(classOf[TaxiiConnection])

// make sure have a clean protocol value
val protocolValue = if (protocol.trim.endsWith(":")) protocol.trim.dropRight(1) else protocol.trim
Expand Down Expand Up @@ -173,7 +173,7 @@ case class TaxiiConnection(host: String,
* @param thePath the url path for the post
* @param jsonValue the JsValue data to send as a json Taxii resource.
* @return either a future Taxii2 error message or a future Taxii2 Status resource.
* Json.stringify(jsonValue)
*
*/
def post(thePath: String, jsonValue: JsValue): Future[Either[TaxiiErrorMessage, TaxiiStatus]] = {
wsClient.url(thePath)
Expand Down Expand Up @@ -209,7 +209,7 @@ case class TaxiiConnection(host: String,
/**
* return the Content-Range string as a tuple of 3 integers,
* start, end and total of the range
* If an error occurs return (0,0,0)
* If an error occurs return (-1,-1,-1)
*
* @param theString the Content-Range string
*/
Expand All @@ -222,7 +222,7 @@ case class TaxiiConnection(host: String,
val total = part(1).toInt
(start, end, total)
} catch {
case ex: Throwable => (0, 0, 0)
case ex: Throwable => (-1, -1, -1)
}
}
}

0 comments on commit 20d341e

Please sign in to comment.