Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2019-02-12 09:00:55 +0000
committerEike Stepper2019-02-12 09:00:55 +0000
commit2e43008167ff49c27a0cc4545fe9877f8a5c5aa9 (patch)
tree5d5e243ec1a8ec5403b214dc0db0882526c32c80 /plugins/org.eclipse.emf.cdo.common/src
parent9b86d2e358a5d6785be4cf1c4502fcde0f5406c0 (diff)
downloadcdo-2e43008167ff49c27a0cc4545fe9877f8a5c5aa9.tar.gz
cdo-2e43008167ff49c27a0cc4545fe9877f8a5c5aa9.tar.xz
cdo-2e43008167ff49c27a0cc4545fe9877f8a5c5aa9.zip
[544363] Make timeout in CDOLobStore configurable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=544363
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.common/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java
index db8ddea670..fbe7e2f416 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java
@@ -42,6 +42,8 @@ public class CDOLobStoreImpl implements CDOLobStore
{
public static final CDOLobStoreImpl INSTANCE = new CDOLobStoreImpl();
+ private long timeout = IOUtil.DEFAULT_TIMEOUT;
+
private File folder;
private int tempID;
@@ -60,6 +62,22 @@ public class CDOLobStoreImpl implements CDOLobStore
this(getDefaultFolder());
}
+ /**
+ * @since 4.8
+ */
+ public long getTimeout()
+ {
+ return timeout;
+ }
+
+ /**
+ * @since 4.8
+ */
+ public void setTimeout(long timeout)
+ {
+ this.timeout = timeout;
+ }
+
public File getFolder()
{
if (!folder.exists())
@@ -80,7 +98,9 @@ public class CDOLobStoreImpl implements CDOLobStore
{
File file = getBinaryFile(info.getID());
long expectedSize = info.getSize();
- return new ExpectedFileInputStream(file, expectedSize);
+ ExpectedFileInputStream inputStream = new ExpectedFileInputStream(file, expectedSize);
+ inputStream.setTimeout(timeout);
+ return inputStream;
}
public CDOLobInfo putBinary(InputStream contents) throws IOException
@@ -117,7 +137,9 @@ public class CDOLobStoreImpl implements CDOLobStore
{
File file = getCharacterFile(info.getID());
long expectedSize = info.getSize();
- return new ExpectedFileReader(file, expectedSize);
+ ExpectedFileReader reader = new ExpectedFileReader(file, expectedSize);
+ reader.setTimeout(timeout);
+ return reader;
}

Back to the top