From 953a5f95f82af133dc8c758641bf9f5f521493b7 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 08 Apr 2009 10:03:27 +0000
Subject: [PATCH] Fix for issue 3686 (makeldif does not parse redirect to file based attribute)
---
opends/src/server/org/opends/server/tools/makeldif/TemplateLine.java | 83 +++++++++++++++++++++++++++++------------
1 files changed, 58 insertions(+), 25 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/makeldif/TemplateLine.java b/opends/src/server/org/opends/server/tools/makeldif/TemplateLine.java
index a145031..2f92503 100644
--- a/opends/src/server/org/opends/server/tools/makeldif/TemplateLine.java
+++ b/opends/src/server/org/opends/server/tools/makeldif/TemplateLine.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Copyright 2006-2008 Sun Microsystems, Inc.
+ * Copyright 2006-2009 Sun Microsystems, Inc.
*/
package org.opends.server.tools.makeldif;
@@ -30,10 +30,6 @@
import org.opends.server.types.AttributeType;
-import static org.opends.server.util.StaticUtils.*;
-
-
-
/**
* This class defines a line that may appear in a template or branch. It may
* contain any number of tags to be evaluated.
@@ -49,23 +45,11 @@
// The set of tags for this template line.
private Tag[] tags;
+ // Whether this line corresponds to an URL value or not.
+ private boolean isURL;
-
- /**
- * Creates a new template line with the provided information.
- *
- * @param attributeType The attribute type for this template line.
- * @param lineNumber The line number on which this template line appears
- * in the template file.
- * @param tags The set of tags for this template line.
- */
- public TemplateLine(AttributeType attributeType, int lineNumber, Tag[] tags)
- {
- this.attributeType = attributeType;
- this.lineNumber = lineNumber;
- this.tags = tags;
- }
-
+ // Whether this line corresponds to a base64 encoded value or not.
+ private boolean isBase64;
/**
@@ -95,15 +79,64 @@
/**
- * Retrieves the set of tags for this template line.
+ * Returns whether the value of this template line corresponds to an URL
+ * or not.
*
- * @return The set of tags for this template line.
+ * @return <CODE>true</CODE> if the value of this template line corresponds
+ * to an URL and <CODE>false</CODE> otherwise.
*/
- public Tag[] getTags()
+ public boolean isURL()
{
- return tags;
+ return isURL;
}
+ /**
+ * Returns whether the value of this template line corresponds to a Base64
+ * encoded value or not.
+ *
+ * @return <CODE>true</CODE> if the value of this template line corresponds
+ * to a Base64 encoded value and <CODE>false</CODE> otherwise.
+ */
+ public boolean isBase64()
+ {
+ return isBase64;
+ }
+
+
+ /**
+ * Creates a new template line with the provided information.
+ *
+ * @param attributeType The attribute type for this template line.
+ * @param lineNumber The line number on which this template line appears
+ * in the template file.
+ * @param tags The set of tags for this template line.
+ */
+ public TemplateLine(AttributeType attributeType, int lineNumber, Tag[] tags)
+ {
+ this(attributeType, lineNumber, tags, false, false);
+ }
+
+
+ /**
+ * Creates a new template line with the provided information.
+ *
+ * @param attributeType The attribute type for this template line.
+ * @param lineNumber The line number on which this template line appears
+ * in the template file.
+ * @param tags The set of tags for this template line.
+ * @param isURL Whether this template line's value is an URL or not.
+ * @param isBase64 Whether this template line's value is Base64 encoded
+ * or not.
+ */
+ public TemplateLine(AttributeType attributeType, int lineNumber, Tag[] tags,
+ boolean isURL, boolean isBase64)
+ {
+ this.attributeType = attributeType;
+ this.lineNumber = lineNumber;
+ this.tags = tags;
+ this.isURL = isURL;
+ this.isBase64 = isBase64;
+ }
/**
--
Gitblit v1.10.0