Skip to content
Snippets Groups Projects
Commit 6bccb265 authored by jakubs's avatar jakubs
Browse files

SSDM-1081 add more helpful error message and one util method

SVN: 32668
parent 7f521396
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ import java.io.Serializable; ...@@ -21,6 +21,7 @@ import java.io.Serializable;
import ch.systemsx.cisd.common.collection.ExtendedLinkedBlockingQueue; import ch.systemsx.cisd.common.collection.ExtendedLinkedBlockingQueue;
import ch.systemsx.cisd.common.collection.IExtendedBlockingQueue; import ch.systemsx.cisd.common.collection.IExtendedBlockingQueue;
import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException;
/** /**
* A factory class for {@link IExtendedBlockingQueue}s. * A factory class for {@link IExtendedBlockingQueue}s.
...@@ -57,7 +58,13 @@ public class PersistentExtendedBlockingQueueFactory ...@@ -57,7 +58,13 @@ public class PersistentExtendedBlockingQueueFactory
public static <E extends Serializable> PersistentExtendedBlockingQueueDecorator<E> createSmartPersist( public static <E extends Serializable> PersistentExtendedBlockingQueueDecorator<E> createSmartPersist(
File queueFile) File queueFile)
{ {
return createSmartQueue(queueFile, false); try
{
return createSmartQueue(queueFile, false);
} catch (Exception rex)
{
throw new EnvironmentFailureException("Could not create/restore queue file " + queueFile.getAbsolutePath(), rex);
}
} }
} }
...@@ -69,12 +69,21 @@ public final class StringUtils ...@@ -69,12 +69,21 @@ public final class StringUtils
* Example: "a", "b", "c" -> "a, b, c" * Example: "a", "b", "c" -> "a, b, c"
*/ */
public final static String joinList(final List<String> list) public final static String joinList(final List<String> list)
{
return joinList(list, ",");
}
/**
* Joins the elements using comma as a separator. <br>
* Example: "a", "b", "c" -> "a, b, c"
*/
public final static String joinList(final List<String> list, String separator)
{ {
if (list == null) if (list == null)
{ {
return null; return null;
} }
return join(list.toArray(new String[0]), ","); return join(list.toArray(new String[0]), separator);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment