vayacondios-server 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/app/http_shim.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require 'vayacondios-server'
4
4
 
5
5
  class HttpShim < Goliath::API
6
- use Vayacondios::Rack::AssumeJSON # assume application/json content type
7
6
  use Goliath::Rack::Tracer, 'X-Tracer' # log trace statistics
8
7
  use Goliath::Rack::Params # parse query string and message body into params hash
9
8
  use Goliath::Rack::Validation::RequestMethod, %w[GET PUT PATCH DELETE] # only allow these methods
@@ -1,3 +1,3 @@
1
1
  class Vayacondios
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
data/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
  <groupId>com.infochimps</groupId>
5
5
  <artifactId>vayacondios</artifactId>
6
6
  <packaging>jar</packaging>
7
- <version>1.0-SNAPSHOT</version>
7
+ <version>1.0.0-SNAPSHOT</version>
8
8
  <name>java-common</name>
9
9
  <url>http://maven.apache.org</url>
10
10
 
@@ -86,7 +86,7 @@ public class HttpHelper {
86
86
  InputStream errorStream = con.getErrorStream();
87
87
  if (errorStream != null) {
88
88
  BufferedReader r = new BufferedReader(new InputStreamReader(errorStream));
89
- try { for (String line; (line = r.readLine()) != null; log.error(line)); }
89
+ try { for (String line; (line = r.readLine()) != null; log.warn(line)); }
90
90
  catch (IOException nested_exc) {
91
91
  log.error("Got an exception in the exception handler: {}", nested_exc);
92
92
  throw e;
@@ -17,6 +17,7 @@ import com.google.gson.JsonSyntaxException;
17
17
 
18
18
  import java.io.BufferedReader;
19
19
  import java.util.HashMap;
20
+ import java.io.FileNotFoundException;
20
21
  import java.io.InputStream;
21
22
  import java.io.OutputStream;
22
23
  import java.io.OutputStreamWriter;
@@ -68,7 +69,13 @@ public class ItemSets extends Organization {
68
69
  * @return a collection of items
69
70
  */
70
71
  public List<Item> fetch(String topic, String id) throws IOException {
71
- BufferedReader reader = openUrl(urlString(PATH_COMPONENT, topic, id));
72
+ BufferedReader reader = null;
73
+ try {
74
+ reader = openUrl(urlString(PATH_COMPONENT, topic, id));
75
+ } catch (FileNotFoundException ex) {
76
+ // In the case of a 404, return an empty set.
77
+ return new ArrayList();
78
+ }
72
79
  String line = reader.readLine();
73
80
  JsonElement response;
74
81
  JsonElement itemSet;
@@ -266,28 +273,28 @@ public class ItemSets extends Organization {
266
273
  //--------------------------------------------------------------------------
267
274
 
268
275
  /**
269
- * @see #ItemSets.fetch
276
+ * @see ItemSets::fetch
270
277
  */
271
278
  public List<Item> fetch(String id) throws IOException {
272
279
  return fetch(getTopic(), id);
273
280
  }
274
281
 
275
282
  /**
276
- * @see #ItemSets.create
283
+ * @see ItemSets::create
277
284
  */
278
285
  public void create(List<Item> items, String id) throws IOException {
279
286
  create(items, getTopic(), id);
280
287
  }
281
288
 
282
289
  /**
283
- * @see #ItemSets.remove
290
+ * @see ItemSets::remove
284
291
  */
285
292
  public void remove(List<Item> items, String id) throws IOException {
286
293
  remove(items, getTopic(), id);
287
294
  }
288
295
 
289
296
  /**
290
- * @see #ItemSets.update
297
+ * @see ItemSets::update
291
298
  */
292
299
  public void update(List<Item> items, String id) throws IOException {
293
300
  update(items, getTopic(), id);
@@ -329,28 +336,28 @@ public class ItemSets extends Organization {
329
336
  //--------------------------------------------------------------------------
330
337
 
331
338
  /**
332
- * @see ItemSets.fetch
339
+ * @see ItemSets::fetch
333
340
  */
334
341
  public List<Item> fetch() throws IOException {
335
342
  return fetch(getId());
336
343
  }
337
344
 
338
345
  /**
339
- * @see ItemSets.create
346
+ * @see ItemSets::create
340
347
  */
341
348
  public void create(List<Item> items) throws IOException {
342
349
  create(items, getId());
343
350
  }
344
351
 
345
352
  /**
346
- * @see ItemSets.remove
353
+ * @see ItemSets::remove
347
354
  */
348
355
  public void remove(List<Item> items) throws IOException {
349
356
  remove(items, getId());
350
357
  }
351
358
 
352
359
  /**
353
- * @see ItemSets.update
360
+ * @see ItemSets::update
354
361
  */
355
362
  public void update(List<Item> items) throws IOException {
356
363
  update(items, getId());
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vayacondios-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-03-06 00:00:00.000000000 Z
15
+ date: 2013-03-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: configliere
@@ -267,7 +267,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
267
267
  version: '0'
268
268
  segments:
269
269
  - 0
270
- hash: -1849202629108369085
270
+ hash: -1404485587736980248
271
271
  required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  none: false
273
273
  requirements:
@@ -276,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  version: '0'
277
277
  segments:
278
278
  - 0
279
- hash: -1849202629108369085
279
+ hash: -1404485587736980248
280
280
  requirements: []
281
281
  rubyforge_project:
282
282
  rubygems_version: 1.8.25