Skip to content

Commit

Permalink
Expose method to get the expanded name from Item in JackrabbitSession
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Jan 17, 2025
1 parent 46beec5 commit e3acbda
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,14 @@ default Node getParentOrNull(@NotNull Item item) throws RepositoryException {
return null;
}
}

/**
* Returns the expanded name of the given {@code Item}.
* @param item the item for which to retrieve the name
* @return the name of the item in expanded form.
* @throws RepositoryException if another error occurs.
* @since 1.76.0
* @see <a href="https://s.apache.org/jcr-2.0-spec/3_Repository_Model.html#3.2.5.1%20Expanded%20Form">JCR 2.0, 3.2.5.1 Expanded Form</a>
*/
@NotNull String getExpandedName(@NotNull Item item) throws RepositoryException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
/**
* Jackrabbit extensions for JCR core interfaces
*/
@org.osgi.annotation.versioning.Version("2.9.0")
@org.osgi.annotation.versioning.Version("2.10.0")
package org.apache.jackrabbit.api;

Original file line number Diff line number Diff line change
Expand Up @@ -852,4 +852,10 @@ public String toString() {
}
return "null";
}

@Override
@NotNull
public String getExpandedName(@NotNull Item item) throws RepositoryException {
return checkItemImpl(item).sessionContext.getExpandedJcrName(item.getName());
}
}

0 comments on commit e3acbda

Please sign in to comment.