Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 60530 invoked from network); 15 Dec 2009 11:47:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Dec 2009 11:47:41 -0000 Received: (qmail 59973 invoked by uid 500); 15 Dec 2009 11:47:41 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 59914 invoked by uid 500); 15 Dec 2009 11:47:40 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 59906 invoked by uid 99); 15 Dec 2009 11:47:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2009 11:47:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2009 11:47:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 13CE3234C498 for ; Tue, 15 Dec 2009 03:47:18 -0800 (PST) Message-ID: <77635840.1260877638067.JavaMail.jira@brutus> Date: Tue, 15 Dec 2009 11:47:18 +0000 (UTC) From: "Felix Meschberger (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-2439) More utility methods in JcrUtils In-Reply-To: <1051146517.1260874998480.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-2439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790702#action_12790702 ] Felix Meschberger commented on JCR-2439: ---------------------------------------- > String toString(Item item) Couldn't we just implement NodeImpl.toString and PropertyImpl.toString ? > addXXX looks reasonable > setXXX sounds useful, but I the "set" prefix sounds a bit strange yet my alternative -- getOrAddXXX -- is probably not better ... > More utility methods in JcrUtils > -------------------------------- > > Key: JCR-2439 > URL: https://issues.apache.org/jira/browse/JCR-2439 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Components: jackrabbit-jcr-commons > Reporter: Jukka Zitting > Priority: Minor > > I'd like to add at least the following utility methods to JcrUtils: > For logging: > // Utility method to simplify log messages and debug prints: > // Node -> "name [type]" > // Property -> "@name = value(s)" > String toString(Item item) > For making sure that a node exists: > // Returns the identified child node. If the child does not already exist, > // it is added using the default node type from the parent. > Node setNode(Node parent, String name) > // Same as above, but ensures that isNodeType(type) is true for the > // returned node, using addNode(name, type) or setPrimaryType(type) > // if needed. > Node setNode(Node parent, String name, String type) > For adding (or setting, see above) nt:folder nodes: > // Adds a new nt:folder node with the given name > Node addFolder(Node parent, String name) > // Ensures that an nt:folder node with the given name exists > Node setFolder(Node parent, String name) > For adding (or setting) nt:file nodes: > // Adds a new nt:file/nt:resource structure > // If the mime type contains a charset parameter, then the jcr:encoding property is also set > Node addFile(Node parent, String name, String mime, InputStream data) > Node addFile(Node parent, String name, String mime, Calendar date, InputStream data) > // Ensures that an nt:file/nt:resource structure exists with the given data. > // Note that the type of a potential existing jcr:content node is not modified > Node setFile(Node parent, String name, String mime, InputStream data) > Node setFile(Node parent, String name, String mime, Calendar date, InputStream data) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.