You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by fm...@apache.org on 2014/07/20 11:26:53 UTC
git commit: [OLINGO-366] provides stream lazy loading (missing
something)
Repository: olingo-odata4
Updated Branches:
refs/heads/master aa0c5713c -> 95a13a4bb
[OLINGO-366] provides stream lazy loading (missing something)
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/95a13a4b
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/95a13a4b
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/95a13a4b
Branch: refs/heads/master
Commit: 95a13a4bb50017039e35a754074e5a36579edaea
Parents: aa0c571
Author: fmartelli <fa...@gmail.com>
Authored: Sun Jul 20 11:26:41 2014 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Sun Jul 20 11:26:41 2014 +0200
----------------------------------------------------------------------
.../olingo/ext/proxy/api/EdmStreamType.java | 24 ++++++++++
.../olingo/ext/proxy/api/EdmStreamTypeImpl.java | 33 ++++++++++++++
.../olingo/ext/proxy/api/EdmStreamValue.java | 46 ++++++++++++++++++++
3 files changed, 103 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/95a13a4b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java
new file mode 100644
index 0000000..b65021a
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.ext.proxy.api;
+
+public interface EdmStreamType {
+
+ EdmStreamValue load();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/95a13a4b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamTypeImpl.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamTypeImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamTypeImpl.java
new file mode 100644
index 0000000..dd18565
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamTypeImpl.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.ext.proxy.api;
+
+public class EdmStreamTypeImpl implements EdmStreamType {
+
+ private final EdmStreamValue value;
+
+ public EdmStreamTypeImpl(final EdmStreamValue value) {
+ this.value = value;
+ }
+
+ @Override
+ public EdmStreamValue load() {
+ return value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/95a13a4b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java
new file mode 100644
index 0000000..fe5c345
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.ext.proxy.api;
+
+import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
+
+public class EdmStreamValue {
+
+ private final String contentType;
+
+ private final InputStream stream;
+
+ public EdmStreamValue(final String contentType, final InputStream stream) {
+ this.contentType = contentType;
+ this.stream = stream;
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public InputStream getStream() {
+ return stream;
+ }
+
+ public void close() {
+ IOUtils.closeQuietly(this.stream);
+ }
+}