Author: glen
Date: Tue Feb 5 12:34:48 2008
New Revision: 13289
Log:
Merge from trunk
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Registry.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/ResourceImporter.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/APPConstants.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeManager.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/Axis2RepositoryMediaTypeHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/SynapseRepositoryMediaTypeHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/WSDLMediaTypeHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/XSDMediaTypeHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentCollectionURLHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentURLHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/TagURLHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/ResourceRequestProcessor.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/utils/Utils.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/utils/RegistryClientUtils.java
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Registry.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Registry.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Registry.java
Tue Feb 5 12:34:48 2008
@@ -22,9 +22,7 @@
import java.util.Date;
import java.util.Map;
-/**
- * API for the Registry. Java applications should use this API to access the
registry.
- */
+/** API for the Registry. Java applications should use this API to access the
registry. */
public interface Registry extends CoreRegistry {
/**
@@ -53,8 +51,8 @@
void delete(String path) throws RegistryException;
/**
- * Move or rename a resource in the registry. This is equivalent to 1)
delete the
- * resource 2) add the resource to the new location.
+ * Move or rename a resource in the registry. This is equivalent to 1)
delete the resource,
+ * then 2) add the resource to the new location.
*
* @param currentPath current path of the resource
* @param newPath where we'd like to move the reosurce
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java
Tue Feb 5 12:34:48 2008
@@ -33,9 +33,7 @@
public static final String REGISTRY_CONFIG_PATH = "registry.config.path";
public static final String REGISTRY_CONTEXT = "registry.context";
- /**
- * Built in user names
- */
+ /** Built in user names */
public static final String SYSTEM_USER = "system";
public static final String SYSTEM_PASSWORD = "system";
public static final String ANONYMOUS_USER = "anonymous";
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/ResourceImporter.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/ResourceImporter.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/ResourceImporter.java
Tue Feb 5 12:34:48 2008
@@ -121,12 +121,12 @@
String msg = "Could not read from the file " + file.getPath();
log.error(msg, e);
throw new RegistryException(msg);
- } finally{
- if (fileStream !=null){
+ } finally {
+ if (fileStream != null) {
try {
fileStream.close();
} catch (IOException e) {
- log.info("Error while closing the file: " +
file.getName());
+ log.info("Error while closing the file: " +
file.getName());
}
}
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/APPConstants.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/APPConstants.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/APPConstants.java
Tue Feb 5 12:34:48 2008
@@ -21,8 +21,8 @@
// Custom elements in Atom feeds and entries
static final String NAMESPACE = "http://wso2.org/registry";
static final QName QNAME_AVGRATING = new QName(NAMESPACE, "AverageRating",
"wso2");
- static final QName COMMENTS_QNAME = new QName(NAMESPACE , "isComments");
- static final QName COMMENTID_QNAME = new QName(NAMESPACE ,"commentID");
+ static final QName COMMENTS_QNAME = new QName(NAMESPACE, "isComments");
+ static final QName COMMENTID_QNAME = new QName(NAMESPACE, "commentID");
static final String IMPORT_MEDIATYPE = "application/resource-import";
static final String PARAMETER_VERSION = "version";
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
Tue Feb 5 12:34:48 2008
@@ -39,16 +39,16 @@
import org.wso2.registry.exceptions.ResourceNotFoundException;
import org.wso2.registry.i18n.Messages;
import org.wso2.registry.jdbc.realm.RegistryRealm;
-import org.wso2.registry.secure.SecureRegistry;
import org.wso2.registry.secure.AuthorizationFailedException;
+import org.wso2.registry.secure.SecureRegistry;
import javax.activation.MimeType;
import javax.xml.namespace.QName;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
-import java.net.URLDecoder;
-import java.io.UnsupportedEncodingException;
public class AtomRegistry extends AbstractProvider implements Provider,
APPConstants {
@@ -137,17 +137,14 @@
// } else {
Resource resource = new Resource();
// }
- String attValue = entry.getSimpleExtension(new QName(NAMESPACE ,
- "directory"));
+ String attValue = entry.getSimpleExtension(new QName(NAMESPACE,
"directory"));
Properties properties =
entry.getExtension(PropertyExtensionFactory.PROPERTIES);
RemoteRegistry.createPropertiesFromExtensionElement(properties,
resource);
- String mediaType = entry.getSimpleExtension(new QName(NAMESPACE ,
- "mediaType"));
+ String mediaType = entry.getSimpleExtension(new QName(NAMESPACE,
"mediaType"));
if (mediaType != null) {
resource.setMediaType(mediaType);
}
- String parentPath = entry.getSimpleExtension(new QName(NAMESPACE ,
- "parentPath"));
+ String parentPath = entry.getSimpleExtension(new QName(NAMESPACE,
"parentPath"));
if (parentPath != null && !"".equals(parentPath)) {
resource.setParentPath(parentPath);
}
@@ -157,9 +154,8 @@
if (entry.getSummary() != null) {
resource.setDescription(entry.getSummary());
}
- String contentModified = entry.getSimpleExtension(
- new QName(NAMESPACE ,
- "contentModified"));
+ String contentModified = entry.getSimpleExtension(new
QName(NAMESPACE,
+
"contentModified"));
if (attValue != null && "true".equals(attValue)) {
// Directory
resource.setDirectory(true);
@@ -275,9 +271,9 @@
String entry_id = getRealPath(request);
String values[] = splitPath(entry_id);
String operation = values[1];
- if (operation !=null ) {
- if (operation.indexOf(":") >0) {
- operation =
operation.substring(0,operation.indexOf(":"));
+ if (operation != null) {
+ if (operation.indexOf(":") > 0) {
+ operation = operation.substring(0,
operation.indexOf(":"));
}
}
if (PARAMETER_RESTORE.equals(operation)) {
@@ -297,7 +293,8 @@
getSecureRegistry(request).rateResource(path,
Integer.parseInt(rate));
} else if (PARAMETER_COMMENTS.equals(operation)) {
String commentString = entry.getContent();
- getSecureRegistry(request).editComment(values[0] + ";" +
values[1], commentString);
+ getSecureRegistry(request)
+ .editComment(values[0] + ";" + values[1],
commentString);
}
}
return new EmptyResponseContext(200);
@@ -328,7 +325,7 @@
resource = getSecureRegistry(request).get(resourcePath);
} catch (ResourceNotFoundException e) {
return new EmptyResponseContext(404);
- } catch(AuthorizationFailedException e) {
+ } catch (AuthorizationFailedException e) {
EmptyResponseContext response = new EmptyResponseContext(401);
response.setHeader("WWW-Authenticate", "Basic
realm=\"WSO2-Registry\"");
return response;
@@ -359,7 +356,7 @@
feed.setSubtitle(Messages.getMessage("resource.version",
resourcePath));
feed.setUpdated(new Date());
feed.addLink(request.getBaseUri() + "atom" + resourcePath);
- feed.addLink(request.getBaseUri() + "atom" + resourcePath
,"self");
+ feed.addLink(request.getBaseUri() + "atom" + resourcePath,
"self");
//Versions will be added as entries
createEntriesFromStringArray(versions,
request.getBaseUri().toString(),
abdera, "versionLink",
@@ -496,13 +493,13 @@
//if the resource is deleted then there will be comment saying that
the resource is
// deleted
if (resource.getState() == RegistryConstants.DELETED_STATE) {
- feed.addSimpleExtension(new QName(NAMESPACE , "state"), "Deleted");
+ feed.addSimpleExtension(new QName(NAMESPACE, "state"), "Deleted");
}
feed.setId("http://wso2.org/jdbcregistry:atom" + resource.getId());
if (resource.getDescription() != null &&
!"".equals(resource.getDescription())) {
feed.setSubtitle(resource.getDescription());
}
- if (resource.getAuthorUserName()!=null) {
+ if (resource.getAuthorUserName() != null) {
feed.addAuthor(resource.getAuthorUserName());
}
feed.setTitle(path);
@@ -513,23 +510,21 @@
}
// resource.getCreatedTime()
if (resource.getCreatedTime() != null) {
- feed.addSimpleExtension(new QName(NAMESPACE ,"createdTime"),
+ feed.addSimpleExtension(new QName(NAMESPACE, "createdTime"),
"" + resource.getCreatedTime().getTime());
}
- feed.addSimpleExtension(new QName(NAMESPACE ,"mediaType"),
- resource.getMediaType());
- feed.addSimpleExtension(new QName(NAMESPACE ,"parentPath"),
- resource.getParentPath());
+ feed.addSimpleExtension(new QName(NAMESPACE, "mediaType"),
resource.getMediaType());
+ feed.addSimpleExtension(new QName(NAMESPACE, "parentPath"),
resource.getParentPath());
path = RemoteRegistry.encodeURL(path);
String href = baseURI + "atom" + path;
feed.addLink(href);
feed.addLink(href, "self");
- feed.addSimpleExtension(new QName(NAMESPACE ,
- "lastUpdatedUser"), resource.getLastUpdaterUserName());
+ feed.addSimpleExtension(new QName(NAMESPACE, "lastUpdatedUser"),
+ resource.getLastUpdaterUserName());
//if the content type is comment then the resource will contains ,
// String array of comments
if (resource.isDirectory()) {
- feed.addSimpleExtension(new QName(NAMESPACE ,"directory"), "true");
+ feed.addSimpleExtension(new QName(NAMESPACE, "directory"), "true");
}
if (exceuteQuery) {
String values[] = (String[])resource.getContent();
@@ -555,7 +550,7 @@
} else {
//Now the resource is a actual resource , so need to send the
content
//adding attribute to indicate the resource is not a directory
- feed.addSimpleExtension(new QName(NAMESPACE ,"directory"),
"false");
+ feed.addSimpleExtension(new QName(NAMESPACE, "directory"),
"false");
Object content = resource.getContent();
Entry entry = abdera.getFactory().newEntry();
String link = baseURI + "atom" + path;
@@ -573,10 +568,10 @@
entry.setContent(content.toString());
}
}
- if (resource.getAuthorUserName()!=null) {
+ if (resource.getAuthorUserName() != null) {
entry.addAuthor(resource.getAuthorUserName());
}
- entry.addLink(resourcePath ,"alternate");
+ entry.addLink(resourcePath, "alternate");
feed.addEntry(entry);
}
}
@@ -599,7 +594,7 @@
Feed feed) {
String authorName = null;
Person person = feed.getAuthor();
- if (person!=null) {
+ if (person != null) {
authorName = person.getName();
feed.addAuthor(authorName);
}
@@ -614,7 +609,7 @@
entry.addLink(nodeLink, "self");
//adding child node as and setting the ref as path
entry.addLink(value, rel);
- if (authorName!=null) {
+ if (authorName != null) {
entry.addAuthor(authorName);
}
entry.setId(nodeLink);
@@ -693,7 +688,7 @@
String uri = request.getUri().toString();
uri = uri.replaceAll(path + "atom", "");
try {
- uri = URLDecoder.decode(uri,"utf-8");
+ uri = URLDecoder.decode(uri, "utf-8");
} catch (UnsupportedEncodingException e) {
// TODO : do anything here?
}
@@ -754,7 +749,7 @@
Entry entry = abdera.getFactory().newEntry();
entry.setTitle(tag.getTagName());
entry.setContent(tag.getTagName());
- entry.addSimpleExtension(new QName(NAMESPACE ,"taggings"), ""
+ tag.getTagCount());
+ entry.addSimpleExtension(new QName(NAMESPACE, "taggings"), ""
+ tag.getTagCount());
feed.addEntry(entry);
}
return feed;
@@ -765,6 +760,7 @@
/**
* This method will give a feed object instance
+ *
* @param abdera : Instance to Abdera
* @return created Feed object
*/
@@ -813,7 +809,7 @@
private Feed getFeedForComments(Abdera abdera, String path, RequestContext
request) {
try {
Feed feed = getFeedInstance(abdera);
- feed.addSimpleExtension(new QName(NAMESPACE ,"directory"), "true");
+ feed.addSimpleExtension(new QName(NAMESPACE, "directory"), "true");
feed.addSimpleExtension(COMMENTS_QNAME, "true");
Comment comments[] = getSecureRegistry(request).getComments(path);
feed.setId("http://wso2.org/registry,Comments" + path);
@@ -864,7 +860,8 @@
Entry entry = abdera.getFactory().newEntry();
String path = tagPath.getResourcePath();
entry.setTitle(path);
- entry.addSimpleExtension(new QName(NAMESPACE ,"taggings"), ""
+ tagPath.getTagCount());
+ entry.addSimpleExtension(new QName(NAMESPACE, "taggings"),
+ "" + tagPath.getTagCount());
Map tagCounts = tagPath.getTagCounts();
Iterator iCounts = tagCounts.keySet().iterator();
java.util.Properties properties = new java.util.Properties();
@@ -943,10 +940,8 @@
entry.setEdited(logentry.getDate());
entry.setContent(logentry.getActionData());
entry.addAuthor(logentry.getUserName());
- entry.addSimpleExtension(new QName(NAMESPACE ,
- "action"), "" + logentry.getAction());
- entry.addSimpleExtension(new QName(NAMESPACE ,
- "path"), logentry.getResourcePath());
+ entry.addSimpleExtension(new QName(NAMESPACE, "action"), "" +
logentry.getAction());
+ entry.addSimpleExtension(new QName(NAMESPACE, "path"),
logentry.getResourcePath());
feed.addEntry(entry);
}
return feed;
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
Tue Feb 5 12:34:48 2008
@@ -42,7 +42,7 @@
import java.net.URLConnection;
import java.util.*;
-public class RemoteRegistry implements Registry, APPConstants {
+public class RemoteRegistry implements Registry, APPConstants {
private String baseURI;
private Log log = LogFactory.getLog(RemoteRegistry.class);
@@ -346,11 +346,12 @@
AbderaClient abderaClient = new AbderaClient(abdera);
Entry entry = abdera.getFactory().newEntry();
entry.setContent(newPath);
- ClientResponse resp = abderaClient.post(baseURI +
encodeURL(currentPath +
-
RegistryConstants.URL_SEPARATOR +
-
PARAMETER_RENAME),
- entry,
- getAuthorization());
+ ClientResponse resp =
+ abderaClient.post(baseURI + encodeURL(currentPath +
+
RegistryConstants.URL_SEPARATOR +
+ PARAMETER_RENAME),
+ entry,
+ getAuthorization());
if (resp.getType() == Response.ResponseType.SUCCESS) {
log.info(Messages.getMessage("resource.rename", currentPath));
} else {
@@ -363,10 +364,11 @@
public String[] getVersions(String path) throws RegistryException {
Abdera abdera = new Abdera();
AbderaClient abderaClient = new AbderaClient(abdera);
- ClientResponse clientResponse = abderaClient.get(baseURI +
encodeURL(path +
-
RegistryConstants.URL_SEPARATOR +
-
PARAMETER_VERSION),
- getAuthorization());
+ ClientResponse clientResponse =
+ abderaClient.get(baseURI + encodeURL(path +
+
RegistryConstants.URL_SEPARATOR +
+ PARAMETER_VERSION),
+ getAuthorization());
Document introspection =
clientResponse.getDocument();
Feed feed = (Feed)introspection.getRoot();
@@ -513,11 +515,12 @@
entry.setUpdated(comment.getTime());
entry.addAuthor(comment.getUser());
entry.setContent(comment.getText());
- ClientResponse resp = abderaClient.post(baseURI +
encodeURL(resourcePath +
-
RegistryConstants.URL_SEPARATOR +
-
PARAMETER_COMMENTS),
- entry,
- getAuthorization());
+ ClientResponse resp =
+ abderaClient.post(baseURI + encodeURL(resourcePath +
+
RegistryConstants.URL_SEPARATOR +
+ PARAMETER_COMMENTS),
+ entry,
+ getAuthorization());
if (resp.getType() == Response.ResponseType.SUCCESS) {
log.info(Messages.getMessage("resource.commented", resourcePath));
return resp.getLocation().toString();
@@ -549,10 +552,11 @@
public Comment[] getComments(String resourcePath) throws RegistryException
{
Abdera abdera = new Abdera();
AbderaClient abderaClient = new AbderaClient(abdera);
- ClientResponse clientResponse = abderaClient.get(baseURI +
encodeURL(resourcePath +
-
RegistryConstants.URL_SEPARATOR +
-
PARAMETER_COMMENTS),
- getAuthorization());
+ ClientResponse clientResponse =
+ abderaClient.get(baseURI + encodeURL(resourcePath +
+
RegistryConstants.URL_SEPARATOR +
+ PARAMETER_COMMENTS),
+ getAuthorization());
Document introspection = clientResponse.getDocument();
Element element = introspection.getRoot();
Feed feed = (Feed)element;
@@ -604,10 +608,11 @@
public float getAverageRating(String resourcePath) throws
RegistryException {
Abdera abdera = new Abdera();
AbderaClient abderaClient = new AbderaClient(abdera);
- ClientResponse clientResponse = abderaClient.get(baseURI +
encodeURL(resourcePath +
-
RegistryConstants.URL_SEPARATOR +
-
PARAMETER_RATINGS),
- getAuthorization());
+ ClientResponse clientResponse =
+ abderaClient.get(baseURI + encodeURL(resourcePath +
+
RegistryConstants.URL_SEPARATOR +
+ PARAMETER_RATINGS),
+ getAuthorization());
Document introspection = clientResponse.getDocument();
Feed feed = (Feed)introspection.getRoot();
String floatvalue = feed.getSimpleExtension(QNAME_AVGRATING);
@@ -694,7 +699,8 @@
requestOptions.addHeader("Action", "" + action);
requestOptions.addHeader("Author", userName);
ClientResponse resp = abderaClient.get(baseURI +
encodeURL(resourcePath +
-
RegistryConstants.URL_SEPARATOR + PARAMETER_LOGS),
+
RegistryConstants.URL_SEPARATOR +
+
PARAMETER_LOGS),
requestOptions);
Document introspection =
resp.getDocument();
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
Tue Feb 5 12:34:48 2008
@@ -218,7 +218,7 @@
try {
exists = resourceDAO.resourceExist(path, conn);
} catch (SQLException e) {
- String msg = Messages.getMessage("faild.to.check",path);
+ String msg = Messages.getMessage("faild.to.check", path);
log.error(msg, e);
throw new RegistryException(msg, e);
@@ -434,7 +434,7 @@
try {
conn.close();
} catch (SQLException ignore) {
- log.info(Messages.getMessage("exception.closing.db"));
+ log.info(Messages.getMessage("exception.closing.db"));
}
}
}
@@ -461,7 +461,7 @@
} catch (SQLException e1) {
e1.printStackTrace();
}
- String msg =
Messages.getMessage("could.not.found.versionpath",path,e.getMessage());
+ String msg = Messages.getMessage("could.not.found.versionpath",
path, e.getMessage());
log.error(msg, e);
throw new RegistryException(msg, e);
@@ -516,7 +516,7 @@
conn.commit();
} catch (SQLException e) {
- String msg = Messages.getMessage("unable.to.restore",versionPath
,e.getMessage());
+ String msg = Messages.getMessage("unable.to.restore", versionPath,
e.getMessage());
log.error(msg, e);
try {
@@ -531,7 +531,7 @@
try {
conn.close();
} catch (SQLException ignore) {
- log.info(Messages.getMessage("exception.closing.db"));
+ log.info(Messages.getMessage("exception.closing.db"));
}
}
}
@@ -737,7 +737,7 @@
try {
conn.close();
} catch (SQLException ignore) {
- log.info(Messages.getMessage("exception.closing.db"));
+ log.info(Messages.getMessage("exception.closing.db"));
}
}
}
@@ -1057,7 +1057,7 @@
try {
conn.close();
} catch (SQLException ignore) {
- log.info(Messages.getMessage("exception.closing.db"));
+ log.info(Messages.getMessage("exception.closing.db"));
}
}
}
@@ -1111,7 +1111,7 @@
try {
conn.close();
} catch (SQLException ignore) {
- log.info(Messages.getMessage("exception.closing.db"));
+ log.info(Messages.getMessage("exception.closing.db"));
}
}
LogEntry[] logEntries = new LogEntry[logEntryList.size()];
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
Tue Feb 5 12:34:48 2008
@@ -172,7 +172,8 @@
return getResourceWithProperties(conn, resource);
}
- private Resource getResourceWithProperties(Connection conn, Resource
resource) throws SQLException {
+ private Resource getResourceWithProperties(Connection conn, Resource
resource)
+ throws SQLException {
String propSQL = "SELECT P.PKEY, P.PVALUE FROM PROPERTIES P WHERE
P.AID=?";
PreparedStatement s3 = conn.prepareStatement(propSQL);
s3.setLong(1, resource.getId());
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeManager.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeManager.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeManager.java
Tue Feb 5 12:34:48 2008
@@ -189,7 +189,7 @@
throws RegistryException {
String parentPath = getParentPath(path);
- String savedPath ;
+ String savedPath;
if (parentPath != null) {
Resource parentCollection =
defaultMediaTypeHandler.get(parentPath, null);
@@ -216,7 +216,7 @@
if (mediaTypeHandler != null) {
if ((savedPath =
mediaTypeHandler.importResource(path, sourceURL,
metadata)) == null) {
-
+
savedPath = defaultMediaTypeHandler.importResource(path,
sourceURL, metadata);
}
} else {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/Axis2RepositoryMediaTypeHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/Axis2RepositoryMediaTypeHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/Axis2RepositoryMediaTypeHandler.java
Tue Feb 5 12:34:48 2008
@@ -87,8 +87,8 @@
String childMediaType = resource.getMediaType();
return
RegistryConstants.AXIS2_CONF_COLLECTION_MEDIA_TYPE.equals(childMediaType) ||
-
RegistryConstants.AXIS2_SERVICES_COLLECTION_MEDIA_TYPE.equals(childMediaType) ||
-
RegistryConstants.AXIS2_MODULES_COLLECTION_MEDIA_TYPE.equals(childMediaType);
+
RegistryConstants.AXIS2_SERVICES_COLLECTION_MEDIA_TYPE.equals(childMediaType) ||
+
RegistryConstants.AXIS2_MODULES_COLLECTION_MEDIA_TYPE.equals(childMediaType);
}
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
Tue Feb 5 12:34:48 2008
@@ -139,12 +139,12 @@
if (resource.isDirectory()) {
if (!a.isDirectory()) {
throw new RegistryException("Trying to add a
collection while a " +
- "resource with the same name exist in the
system");
+ "resource with the same
name exist in the system");
}
} else {
if (a.isDirectory()) {
throw new RegistryException("Trying to add a resource
while a " +
- "collection with the same name exist in the
system");
+ "collection with the same
name exist in the system");
}
}
if (resource.isContentModified() ||
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/SynapseRepositoryMediaTypeHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/SynapseRepositoryMediaTypeHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/SynapseRepositoryMediaTypeHandler.java
Tue Feb 5 12:34:48 2008
@@ -109,11 +109,11 @@
String childMediaType = resource.getMediaType();
return
RegistryConstants.SYNAPSE_CONF_COLLECTION_MEDIA_TYPE.equals(childMediaType) ||
-
RegistryConstants.SYNAPSE_SEQUENCE_COLLECTION_MEDIA_TYPE.equals(childMediaType)
||
-
RegistryConstants.SYNAPSE_ENDPOINT_COLLECTION_MEDIA_TYPE.equals(childMediaType)
||
-
RegistryConstants.SYNAPSE_PROXY_SERVICES_COLLECTION_MEDIA_TYPE.equals(childMediaType)
- ||
RegistryConstants.SYNAPSE_TASKS_COLLECTION_MEDIA_TYPE.equals(childMediaType) ||
-
RegistryConstants.SYNAPSE_ENTRIES_COLLECTION_MEDIA_TYPE.equals(childMediaType);
+
RegistryConstants.SYNAPSE_SEQUENCE_COLLECTION_MEDIA_TYPE.equals(childMediaType)
||
+
RegistryConstants.SYNAPSE_ENDPOINT_COLLECTION_MEDIA_TYPE.equals(childMediaType)
||
+
RegistryConstants.SYNAPSE_PROXY_SERVICES_COLLECTION_MEDIA_TYPE.equals(childMediaType)
+ ||
RegistryConstants.SYNAPSE_TASKS_COLLECTION_MEDIA_TYPE.equals(childMediaType) ||
+
RegistryConstants.SYNAPSE_ENTRIES_COLLECTION_MEDIA_TYPE.equals(childMediaType);
}
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/WSDLMediaTypeHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/WSDLMediaTypeHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/WSDLMediaTypeHandler.java
Tue Feb 5 12:34:48 2008
@@ -19,10 +19,10 @@
import org.wso2.registry.RegistryConstants;
import org.wso2.registry.RegistryException;
import org.wso2.registry.Resource;
-import org.wso2.registry.utils.AuthorizationUtil;
import org.wso2.registry.jdbc.mediatypes.MediaTypeHandler;
import org.wso2.registry.jdbc.mediatypes.MediaTypeManager;
import org.wso2.registry.jdbc.mediatypes.utils.WSDLFileProcessor;
+import org.wso2.registry.utils.AuthorizationUtil;
import org.wso2.usermanager.Realm;
import javax.sql.DataSource;
@@ -54,7 +54,8 @@
public String importResource(String path, String sourceURL, Resource
metadata)
throws RegistryException {
- String savedName = wsdlFileProcessor.saveWSDLFileToRegistry(sourceURL,
getParentPath(path), true, metadata);
+ String savedName = wsdlFileProcessor
+ .saveWSDLFileToRegistry(sourceURL, getParentPath(path), true,
metadata);
String parentPath = AuthorizationUtil.getParentPath(path);
if (parentPath.endsWith(RegistryConstants.PATH_SEPARATOR)) {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/XSDMediaTypeHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/XSDMediaTypeHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/XSDMediaTypeHandler.java
Tue Feb 5 12:34:48 2008
@@ -19,10 +19,10 @@
import org.wso2.registry.RegistryConstants;
import org.wso2.registry.RegistryException;
import org.wso2.registry.Resource;
-import org.wso2.registry.utils.AuthorizationUtil;
import org.wso2.registry.jdbc.mediatypes.MediaTypeHandler;
import org.wso2.registry.jdbc.mediatypes.MediaTypeManager;
import org.wso2.registry.jdbc.mediatypes.utils.SchemaFileProcessor;
+import org.wso2.registry.utils.AuthorizationUtil;
import org.wso2.usermanager.Realm;
import javax.sql.DataSource;
@@ -56,7 +56,7 @@
throws RegistryException {
String savedName = schemaFileProcessor
- .saveSchemaFileToRegistry(sourceURL, getParentPath(path),
true, metadata);
+ .saveSchemaFileToRegistry(sourceURL, getParentPath(path),
true, metadata);
String parentPath = AuthorizationUtil.getParentPath(path);
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
Tue Feb 5 12:34:48 2008
@@ -26,7 +26,6 @@
import org.wso2.registry.jdbc.mediatypes.builtin.DefaultMediaTypeHandler;
import org.xml.sax.InputSource;
-import javax.xml.transform.OutputKeys;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.util.*;
@@ -51,13 +50,13 @@
*/
public String saveSchemaFileToRegistry(String location,
- String registryBasePath,
- boolean processInclueds,
- Resource metadata)
+ String registryBasePath,
+ boolean processInclueds,
+ Resource metadata)
throws RegistryException {
return saveSchemaFileToRegistry(location, new HashMap(),
registryBasePath, processInclueds,
- metadata);
+ metadata);
}
/**
@@ -65,10 +64,10 @@
* @param processedSchemaMap - this map contains schema source URI vs new
schema locaitons.
*/
public String saveSchemaFileToRegistry(String location,
- Map processedSchemaMap,
- String registryBasePath,
- boolean processInclueds,
- Resource metadata)
+ Map processedSchemaMap,
+ String registryBasePath,
+ boolean processInclueds,
+ Resource metadata)
throws RegistryException {
XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
@@ -116,9 +115,9 @@
// set this as an visited schema to stop recursion
visitedShemas.add(xmlSchema.getSourceURI());
if (includes != null) {
- Object externalComponet ;
- XmlSchemaExternal xmlSchemaExternal ;
- XmlSchema innerSchema ;
+ Object externalComponet;
+ XmlSchemaExternal xmlSchemaExternal;
+ XmlSchema innerSchema;
for (Iterator iter = includes.getIterator(); iter.hasNext();) {
externalComponet = iter.next();
if (externalComponet instanceof XmlSchemaExternal) {
@@ -177,9 +176,9 @@
// set this as an visited schema to stop recursion
visitedShemas.add(xmlSchema.getSourceURI());
if (includes != null) {
- Object externalComponet ;
- XmlSchemaExternal xmlSchemaExternal ;
- XmlSchema innerSchema ;
+ Object externalComponet;
+ XmlSchemaExternal xmlSchemaExternal;
+ XmlSchema innerSchema;
for (Iterator iter = includes.getIterator(); iter.hasNext();) {
externalComponet = iter.next();
if (externalComponet instanceof XmlSchemaExternal) {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
Tue Feb 5 12:34:48 2008
@@ -63,8 +63,8 @@
boolean processImports,
Resource metadata)
throws RegistryException {
- WSDLReader wsdlReader ;
- String fileNameToSave ;
+ WSDLReader wsdlReader;
+ String fileNameToSave;
try {
wsdlReader = WSDLFactory.newInstance().newWSDLReader();
@@ -74,7 +74,7 @@
}
wsdlReader.setFeature("javax.wsdl.importDocuments", true);
- Definition wsdlDefinition ;
+ Definition wsdlDefinition;
try {
wsdlDefinition = wsdlReader.readWSDL(location);
@@ -83,15 +83,15 @@
fileNameToSave = wsdlFileName.substring(0,
wsdlFileName.indexOf(".")) + ".wsdl";
} catch (WSDLException e) {
String msg = "Could not read the wsdl at location " + location +
". Caused by: " +
- e.getMessage();
+ e.getMessage();
throw new RegistryException(msg);
}
Map processedWSDLMap = new HashMap();
calculateWSDLNamesAndChangeTypes(wsdlDefinition, processedWSDLMap, new
HashMap(),
- new HashSet(), registryBasePath, processImports);
+ new HashSet(), registryBasePath,
processImports);
saveWSDLFileToRegistry(wsdlDefinition, processedWSDLMap, new
HashSet(), registryBasePath,
- processImports, metadata);
+ processImports, metadata);
return fileNameToSave;
}
@@ -116,8 +116,8 @@
if (processImports) {
Iterator iter = wsdlDefinition.getImports().values().iterator();
- Vector values ;
- Import wsdlImport ;
+ Vector values;
+ Import wsdlImport;
// add this to visited list to stop recursion
visitedWSDLs.add(wsdlDefinition.getDocumentBaseURI());
for (; iter.hasNext();) {
@@ -140,12 +140,12 @@
Types types = wsdlDefinition.getTypes();
if (types != null) {
List extensibleElements = types.getExtensibilityElements();
- Schema schemaExtension ;
- Object extensionObject ;
- XmlSchema xmlSchema ;
- XmlSchemaCollection xmlSchemaCollection ;
- SchemaFileProcessor schemaFileProcessor ;
- Map changedLocationMap ;
+ Schema schemaExtension;
+ Object extensionObject;
+ XmlSchema xmlSchema;
+ XmlSchemaCollection xmlSchemaCollection;
+ SchemaFileProcessor schemaFileProcessor;
+ Map changedLocationMap;
String basuri = wsdlDefinition.getDocumentBaseURI();
basuri = basuri.substring(0, basuri.lastIndexOf("/") + 1);
for (Iterator extensibleElementsIter =
extensibleElements.iterator();
@@ -196,8 +196,8 @@
// first we have to process the imports and change the
// schema locations suite for the registry
Iterator iter = wsdlDefinition.getImports().values().iterator();
- Vector values ;
- Import wsdlImport ;
+ Vector values;
+ Import wsdlImport;
// add this to visited list to stop recursion
visitedWSDLs.add(wsdlDefinition.getDocumentBaseURI());
for (; iter.hasNext();) {
@@ -209,7 +209,7 @@
if
(!visitedWSDLs.contains(innerDefinition.getDocumentBaseURI())) {
// we have not process this wsdl file earlier
saveWSDLFileToRegistry(innerDefinition,
processedWSDLMap, visitedWSDLs,
- registryBasePath, processImports, null);
+ registryBasePath,
processImports, null);
}
// set the import location according to the new location
wsdlImport.setLocationURI((String)processedWSDLMap.get(
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/SQLQueryProcessor.java
Tue Feb 5 12:34:48 2008
@@ -122,7 +122,7 @@
try {
conn.close();
} catch (SQLException ignore) {
- log.info("exception.closing.db");
+ log.info("exception.closing.db");
}
}
}
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentCollectionURLHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentCollectionURLHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentCollectionURLHandler.java
Tue Feb 5 12:34:48 2008
@@ -16,8 +16,6 @@
package org.wso2.registry.jdbc.urlhandlers;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.wso2.registry.Comment;
import org.wso2.registry.Registry;
import org.wso2.registry.RegistryException;
@@ -25,8 +23,6 @@
/** Handles URLs in the form <path>?comments. e.g.
/project/services/inventoryService?comments */
public class CommentCollectionURLHandler extends URLHandler {
-
- private static final Log log =
LogFactory.getLog(CommentCollectionURLHandler.class);
private Registry registry;
public CommentCollectionURLHandler(Registry registry) {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentURLHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentURLHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/CommentURLHandler.java
Tue Feb 5 12:34:48 2008
@@ -19,9 +19,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.registry.*;
+import org.wso2.registry.jdbc.dao.CommentsDAO;
import org.wso2.registry.secure.AuthorizationFailedException;
import org.wso2.registry.utils.AuthorizationUtil;
-import org.wso2.registry.jdbc.dao.CommentsDAO;
import org.wso2.usermanager.Realm;
import org.wso2.usermanager.UserManagerException;
@@ -42,8 +42,10 @@
/**
* Accepts URL in the form <path>;comments:<comment-id>
*
- * @param url
- * @return
+ * @param url URL to process
+ * @return Resource instance if the URL can be processed. Null if the
request cannot be
+ * processed.
+ * @throws RegistryException
*/
public Resource get(String url) throws RegistryException {
@@ -92,7 +94,7 @@
} catch (SQLException e) {
String msg = "Could not get the comment with ID: " + cID +
- ". Caused by: " + e.getMessage();
+ ". Caused by: " + e.getMessage();
log.error(msg, e);
throw new RegistryException(msg);
@@ -191,7 +193,8 @@
!realm.getAuthorizer().isUserAuthorized(userID, authPath,
ActionConstants.PUT)) {
String msg = "User: " + userID +
- " is not authorized to delete the comment on the
resource: " + authPath;
+ " is not authorized to delete the comment on the
resource: " +
+ authPath;
log.info(msg);
throw new AuthorizationFailedException(msg);
}
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/TagURLHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/TagURLHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/TagURLHandler.java
Tue Feb 5 12:34:48 2008
@@ -16,14 +16,14 @@
package org.wso2.registry.jdbc.urlhandlers;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.wso2.registry.RegistryConstants;
import org.wso2.registry.RegistryException;
import org.wso2.registry.Resource;
import org.wso2.registry.jdbc.dao.TagsDAO;
import org.wso2.registry.jdbc.dataobjects.TaggingDO;
import org.wso2.usermanager.Realm;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import javax.sql.DataSource;
import java.sql.Connection;
@@ -40,8 +40,9 @@
/**
* Accepts the URLs in the form <path>;tags:<tag-name>:<user-name>
*
- * @param url
- * @return
+ * @param url URL to process
+ * @return Resource instance if the URL can be processed. Null if the
request cannot be
+ * processed.
* @throws RegistryException
*/
public Resource get(String url) throws RegistryException {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
Tue Feb 5 12:34:48 2008
@@ -275,7 +275,7 @@
// a resource metadata, the permission stuff should also be
handled in
// the url handlers. Because there is no way to interpret the
path and identify
// the action at his point.
-
+
if (!authorizer.isUserAuthorized(userID, authPath,
ActionConstants.DELETE)) {
String msg = "Attempted to perform unauthorized
operation.";
log.info(msg);
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java
Tue Feb 5 12:34:48 2008
@@ -34,8 +34,8 @@
import org.wso2.registry.secure.SecureRegistry;
import org.wso2.registry.servlet.utils.Utils;
import org.wso2.usermanager.AccessControlAdmin;
-import org.wso2.usermanager.UserManagerException;
import org.wso2.usermanager.UserManagerConstants;
+import org.wso2.usermanager.UserManagerException;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -129,9 +129,9 @@
Resource systemCollection = new Resource();
systemCollection.setDirectory(true);
String systemDesc = "This collection is used to store system data
of the " +
- "WSO2 Registry server. User nor the admins of the registry
are not expected " +
- "to edit any content of this collection. Changing content
of this collection " +
- "may result in unexpected behaviors.";
+ "WSO2 Registry server. User nor the admins of
the registry are not expected " +
+ "to edit any content of this collection.
Changing content of this collection " +
+ "may result in unexpected behaviors.";
systemCollection.setDescription(systemDesc);
systemRegistry.put("/system", systemCollection);
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/ResourceRequestProcessor.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/ResourceRequestProcessor.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/ResourceRequestProcessor.java
Tue Feb 5 12:34:48 2008
@@ -108,7 +108,7 @@
HttpServletResponse response,
String path) {
- Resource resource ;
+ Resource resource;
try {
resource = ResourceRequestProcessor.getResource(request, path);
try {
@@ -135,8 +135,8 @@
}
}
-
} catch (IOException e) {
+ setErrorMessage(request, e.getMessage());
}
} catch (RegistryException e) {
setErrorMessage(request, e.getMessage());
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/utils/Utils.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/utils/Utils.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/servlet/utils/Utils.java
Tue Feb 5 12:34:48 2008
@@ -89,7 +89,8 @@
SecureRegistry userRegistry =
(SecureRegistry)request.getSession().getAttribute(RegistryConstants.USER_REGISTRY);
- return userRegistry != null &&
!userRegistry.getUserID().equals(RegistryConstants.ANONYMOUS_USER);
+ return userRegistry != null &&
+
!userRegistry.getUserID().equals(RegistryConstants.ANONYMOUS_USER);
}
public static void logInUser(HttpServletRequest request, String userName,
String password)
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/utils/RegistryClientUtils.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/utils/RegistryClientUtils.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/utils/RegistryClientUtils.java
Tue Feb 5 12:34:48 2008
@@ -18,12 +18,12 @@
*/
package org.wso2.registry.utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.wso2.registry.Registry;
import org.wso2.registry.RegistryException;
import org.wso2.registry.Resource;
import org.wso2.registry.i18n.Messages;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.io.File;
import java.io.FileInputStream;
@@ -113,7 +113,7 @@
File file = new File(toFile, resource.getPath());
boolean fileFlag = file.mkdirs();
if (!fileFlag) {
- log.info("Unable to create the directory " +
resource.getPath());
+ log.info("Unable to create the directory " +
resource.getPath());
} else {
String childNodes[] = (String[])resource.getContent();
for (String childNode : childNodes) {
@@ -125,7 +125,7 @@
try {
boolean fileFlag = file.createNewFile();
if (!fileFlag) {
- log.info("Unable to create the file " +
resource.getPath());
+ log.info("Unable to create the file " +
resource.getPath());
} else {
FileOutputStream out = new FileOutputStream(file);
out.write((byte[])resource.getContent());
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev