mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 13:47:57 +01:00
Increase number of nodes supported.
This commit is contained in:
parent
ba80f9479c
commit
c3be0b6552
@ -37,15 +37,15 @@ public class InvalidMindmapException
|
||||
}
|
||||
|
||||
static public InvalidMindmapException emptyMindmap() {
|
||||
return new InvalidMindmapException(EMPTY_MINDMAP,"<empty string>");
|
||||
return new InvalidMindmapException(EMPTY_MINDMAP, "<empty string>");
|
||||
}
|
||||
|
||||
static public InvalidMindmapException invalidFormat(@Nullable String xmlDoc) {
|
||||
return new InvalidMindmapException(INVALID_MINDMAP_FORMAT,xmlDoc);
|
||||
return new InvalidMindmapException(INVALID_MINDMAP_FORMAT, xmlDoc);
|
||||
}
|
||||
|
||||
static public InvalidMindmapException tooBigMindnap() {
|
||||
return new InvalidMindmapException(TOO_BIG_MINDMAP,"<too-big>");
|
||||
static public InvalidMindmapException tooBigMindnap(int numberOfTopics) {
|
||||
return new InvalidMindmapException(TOO_BIG_MINDMAP, "<too-big " + numberOfTopics + ">");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
abstract public class MindmapUtils {
|
||||
|
||||
private static final int MAX_SUPPORTED_NODES = 500;
|
||||
private static final int MAX_SUPPORTED_NODES = 1000;
|
||||
|
||||
public static void verifyMindmap(@Nullable String xmlDoc) throws InvalidMindmapException {
|
||||
if (xmlDoc == null || xmlDoc.trim().isEmpty()) {
|
||||
@ -20,8 +20,9 @@ abstract public class MindmapUtils {
|
||||
}
|
||||
|
||||
// Validate that the number of nodes is not bigger 500 nodes.
|
||||
if (xmlDoc.split("<topic").length > MAX_SUPPORTED_NODES) {
|
||||
throw InvalidMindmapException.tooBigMindnap();
|
||||
int numberOfTopics = xmlDoc.split("<topic").length;
|
||||
if (numberOfTopics > MAX_SUPPORTED_NODES) {
|
||||
throw InvalidMindmapException.tooBigMindnap(numberOfTopics);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user