You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/07/17 10:34:04 UTC

git commit: [OLINGO-373] should support reading proxy code' META-INF files in eclipse ADT app' way

Repository: olingo-odata4
Updated Branches:
  refs/heads/clientjune f40643f92 -> d6d330077


[OLINGO-373] should support reading proxy code' META-INF files in eclipse ADT app' way


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/d6d33007
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/d6d33007
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/d6d33007

Branch: refs/heads/clientjune
Commit: d6d3300778bf6c76ae1761184cab896f36358721
Parents: f40643f
Author: challenh <ch...@microsoft.com>
Authored: Thu Jul 17 16:31:17 2014 +0800
Committer: challenh <ch...@microsoft.com>
Committed: Thu Jul 17 16:31:17 2014 +0800

----------------------------------------------------------------------
 .../org/apache/olingo/ext/proxy/utils/CoreUtils.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d6d33007/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
index 5e44e74..a69fec9 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
@@ -611,9 +611,17 @@ public final class CoreUtils {
     }
 
     try {
-      final List<String> pkgs = IOUtils.readLines(
-              Thread.currentThread().getContextClassLoader().getResourceAsStream(proxyClassListFile),
-              Constants.UTF8);
+      java.io.InputStream fileStream = 
+    	  Thread.currentThread().getContextClassLoader().getResourceAsStream(proxyClassListFile);
+      if(fileStream == null) {
+        // maven can easily build those files to META-INF/ folder, but if user wants to use eclipse ADT,
+        //   not maven, they can't do that. the app will be broken by exception at runtime.
+        // so here: when reading from META-INF/ folder fails, then try reading those 3 files from 
+        //   'asserts/META-INF/' folder, where eclipse ADT is able to place those 3 files.
+        fileStream =
+          Thread.currentThread().getContextClassLoader().getResourceAsStream("assets/"+proxyClassListFile);
+      }
+      final List<String> pkgs = IOUtils.readLines(fileStream, Constants.UTF8);
 
       for (String pkg : pkgs) {
         final Class<?> clazz = Class.forName(pkg);