Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2019 Open Identity Platform Community.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.openidentityplatform.commons.cassandra;
Expand Down Expand Up @@ -64,9 +65,9 @@ public void run() {
Files.createDirectory(Paths.get("target"));
}
if (!Files.exists(Paths.get("target"+File.separator+"embedded_keystore"))) {
Files.copy(this.getClass().getResourceAsStream("/embedded_keystore"),Paths.get("target"+File.separator+"embedded_keystore"),StandardCopyOption.REPLACE_EXISTING);
Files.copy(EmbeddedServer.class.getResourceAsStream("/embedded_keystore"),Paths.get("target"+File.separator+"embedded_keystore"),StandardCopyOption.REPLACE_EXISTING);
}
Files.copy(this.getClass().getResourceAsStream("/cassandra.yaml"),Paths.get("target"+File.separator+"cassandra.yaml"),StandardCopyOption.REPLACE_EXISTING);
Files.copy(EmbeddedServer.class.getResourceAsStream("/cassandra.yaml"),Paths.get("target"+File.separator+"cassandra.yaml"),StandardCopyOption.REPLACE_EXISTING);
System.setProperty("cassandra.config",""+Paths.get("target"+File.separator+"cassandra.yaml").toUri());
//start
// final CountDownLatch startupLatch = new CountDownLatch(1) ;
Expand Down Expand Up @@ -96,7 +97,7 @@ public void run() {
}
//load
String dataSetLocation=System.getProperty(EmbeddedServer.class.getPackage().getName()+".import","cassandra/import.cql");
InputStream inputStream=this.getClass().getResourceAsStream("/" + dataSetLocation);
InputStream inputStream=EmbeddedServer.class.getResourceAsStream("/" + dataSetLocation);
if (inputStream!=null) {
try (CqlSession session = CqlSession.builder().withApplicationName("load cassandra/import.cql").build()){
for (String statement : Arrays.asList(StringUtils.normalizeSpace(inputStreamToString(inputStream)).split(";"))) {
Expand All @@ -115,7 +116,7 @@ public void run() {
//load test
dataSetLocation=System.getProperty(EmbeddedServer.class.getPackage().getName()+".import.test");
if (dataSetLocation!=null) {
inputStream=this.getClass().getResourceAsStream("/" + dataSetLocation);
inputStream=EmbeddedServer.class.getResourceAsStream("/" + dataSetLocation);
if (inputStream==null) {
throw new AssertionError("cannot get resource "+dataSetLocation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private Map<String, JsonValue> readCoreEventTopicSchemas() {
}

private InputStream getResourceAsStream(String resourcePath) {
return new BufferedInputStream(getClass().getResourceAsStream(resourcePath));
return new BufferedInputStream(EventTopicsMetaDataBuilder.class.getResourceAsStream(resourcePath));
}

private void extendCoreEventTopicsSchemas(Map<String, JsonValue> auditEventTopicSchemas) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.audit;
Expand Down Expand Up @@ -60,7 +61,7 @@ public Handler start() throws HttpApplicationException {
AuditServiceBuilder auditServiceBuilder = newAuditService();
auditServiceBuilder.withConfiguration(auditServiceConfiguration);

try (final InputStream eventHandlersConfig = this.getClass().getResourceAsStream(AUDIT_EVENT_HANDLERS_CONFIG)) {
try (final InputStream eventHandlersConfig = AuditHttpApplication.class.getResourceAsStream(AUDIT_EVENT_HANDLERS_CONFIG)) {
JsonValue auditEventHandlers = getJson(eventHandlersConfig).get(EVENT_HANDLERS);
for (final JsonValue handlerConfig : auditEventHandlers) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2015 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven;
Expand Down Expand Up @@ -64,7 +65,7 @@ private void loadVersions() {
InputStream inputStream = null;

try {
inputStream = getClass().getResourceAsStream("/versions.properties");
inputStream = AbstractDocbkxMojo.class.getResourceAsStream("/versions.properties");
if (inputStream == null) {
throw new IOException("Could not read properties resource");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2015 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.post;
Expand Down Expand Up @@ -114,7 +115,7 @@ final void editBuiltHtml(final String htmlDir) throws

if(m.getGoogleAnalyticsId() != null) {
String gascript = IOUtils.toString(
getClass().getResourceAsStream("/endhead-ga.txt"), "UTF-8");
Bootstrap.class.getResourceAsStream("/endhead-ga.txt"), "UTF-8");
gascript = gascript.replace("ANALYTICS-ID", m.getGoogleAnalyticsId());
replacements.put("</head>", gascript);
}
Expand All @@ -133,7 +134,7 @@ final void addDraftAlert(final String htmlDir) throws
try {
HashMap<String, String> replacements = new HashMap<String, String>();
String draftAlert = IOUtils.toString(
getClass().getResourceAsStream("/endbody-draftalert.txt"), "UTF-8");
Bootstrap.class.getResourceAsStream("/endbody-draftalert.txt"), "UTF-8");
replacements.put("</body>", draftAlert);
HtmlUtils.updateHtml(htmlDir, replacements);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2014 ForgeRock AS
* Portions copyright 2024 3A Systems LLC.
* Portions copyright 2024-2026 3A Systems LLC.
*/

package org.forgerock.doc.maven.post;
Expand Down Expand Up @@ -131,7 +131,7 @@ public void execute() throws MojoExecutionException {
*/
private void addScript() throws MojoExecutionException {

final URL scriptUrl = getClass().getResource("/js/" + m.getJavaScriptFileName());
final URL scriptUrl = Html.class.getResource("/js/" + m.getJavaScriptFileName());
String scriptString;
try {
scriptString = IOUtils.toString(scriptUrl);
Expand Down Expand Up @@ -197,16 +197,16 @@ final void editBuiltHtml(final String htmlDir) throws MojoExecutionException {
HashMap<String, String> replacements = new HashMap<>();

String doctype = IOUtils.toString(
getClass().getResourceAsStream("/starthtml-doctype.txt"), StandardCharsets.UTF_8);
Html.class.getResourceAsStream("/starthtml-doctype.txt"), StandardCharsets.UTF_8);
replacements.put("<html>", doctype);

// See https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
String robots = "<head>" + System.getProperty("line.separator")
+ IOUtils.toString(getClass().getResourceAsStream("/robots.txt"), StandardCharsets.UTF_8);
+ IOUtils.toString(Html.class.getResourceAsStream("/robots.txt"), StandardCharsets.UTF_8);
replacements.put("<head>", robots);

String favicon = IOUtils.toString(
getClass().getResourceAsStream("/endhead-favicon.txt"), StandardCharsets.UTF_8);
Html.class.getResourceAsStream("/endhead-favicon.txt"), StandardCharsets.UTF_8);
favicon = favicon.replace("FAVICON-LINK", m.getFaviconLink());
replacements.put("</head>", favicon);

Expand All @@ -215,7 +215,7 @@ final void editBuiltHtml(final String htmlDir) throws MojoExecutionException {
String gascript = "";
if(m.getGoogleAnalyticsId() != null && !"".equals(m.getGoogleAnalyticsId())) {
gascript = IOUtils.toString(
getClass().getResourceAsStream("/endbody-ga.txt"), StandardCharsets.UTF_8);
Html.class.getResourceAsStream("/endbody-ga.txt"), StandardCharsets.UTF_8);
gascript = gascript.replace("ANALYTICS-ID", m.getGoogleAnalyticsId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2015 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.post;
Expand Down Expand Up @@ -58,7 +59,7 @@ public void execute() throws MojoExecutionException {
try {
// See https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
String robots = "<head>" + System.getProperty("line.separator")
+ IOUtils.toString(getClass().getResourceAsStream("/robots.txt"), "UTF-8");
+ IOUtils.toString(WebhelpPost.class.getResourceAsStream("/robots.txt"), "UTF-8");
replacements.put("<head>", robots);
HtmlUtils.updateHtml(webhelpDir.getPath(), replacements);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2014 ForgeRock AS
* Portions copyright 2024 3A Systems LLC.
* Portions copyright 2024-2026 3A Systems LLC.
*/

package org.forgerock.doc.maven.release;
Expand Down Expand Up @@ -56,7 +56,7 @@ public void execute() throws MojoExecutionException {
FileUtils.deleteQuietly(indexHtml);

try {
String content = IOUtils.toString(getClass().getResource("/dfo.index.html"), StandardCharsets.UTF_8);
String content = IOUtils.toString(IndexHtml.class.getResource("/dfo.index.html"), StandardCharsets.UTF_8);
content = content.replace("PRODUCT", m.getProjectName().toLowerCase());
content = content.replace("VERSION", m.getReleaseVersion());
if(m.getGoogleAnalyticsId() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.release;
Expand Down Expand Up @@ -54,7 +55,7 @@ public void execute() throws MojoExecutionException {

try {
final String robots = IOUtils.toString(
getClass().getResourceAsStream("/robots.txt"), "UTF-8");
Robots.class.getResourceAsStream("/robots.txt"), "UTF-8");

replacements.put(robots, ""); // Replace the tag with an empty string.
HtmlUtils.updateHtml(m.getReleaseVersionPath(), replacements);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2014 ForgeRock AS
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.site;
Expand Down Expand Up @@ -54,7 +55,7 @@ public void execute() throws MojoExecutionException {

FileUtils.deleteQuietly(htaccess);
try {
FileUtils.copyURLToFile(getClass().getResource("/.htaccess"), htaccess);
FileUtils.copyURLToFile(Htaccess.class.getResource("/.htaccess"), htaccess);
HtmlUtils.addHtaccess(layoutDir, htaccess);
} catch (IOException e) {
throw new MojoExecutionException("Failed to copy .htaccess: " + e.getMessage(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2014 ForgeRock AS
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.site;
Expand Down Expand Up @@ -52,7 +53,7 @@ public void execute() throws MojoExecutionException {
try {
File file = FileUtils.getFile(m.getSiteDirectory(), "doc", "index.html");
if (!file.exists()) {
String redirect = IOUtils.toString(getClass().getResourceAsStream("/index.html"), "UTF-8");
String redirect = IOUtils.toString(Redirect.class.getResourceAsStream("/index.html"), "UTF-8");
redirect = redirect.replaceAll("PROJECT", m.getProjectName())
.replaceAll("LOWERCASE", m.getProjectName().toLowerCase());
FileUtils.write(file, redirect, "UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2015 ForgeRock AS
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.utils;
Expand Down Expand Up @@ -91,7 +92,7 @@ private void addBootstrapSwf() throws IOException {
private void addBootstrapResources(final String[] resources) throws IOException {

for (String resource : resources) {
URL resourceUrl = getClass().getResource(resource);
URL resourceUrl = BootstrapCopier.class.getResource(resource);

// The html.stylesheet parameter should probably take URLs.
// When local files are referenced,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.utils;
Expand Down Expand Up @@ -105,7 +106,7 @@ private void addShScripts() throws IOException {
private void addShResources(final String[] resources) throws IOException {

for (String resource : resources) {
URL resourceUrl = getClass().getResource(resource);
URL resourceUrl = SyntaxHighlighterCopier.class.getResource(resource);

// The html.stylesheet parameter should probably take URLs.
// When local files are referenced,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2015 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.doc.maven.utils;
Expand Down Expand Up @@ -96,7 +97,7 @@ public XmlTransformer(final String xsl, final FileFilter filterToMatch) {
private Transformer getTransformer(final String xslResource)
throws IOException, TransformerConfigurationException {
TransformerFactory factory = TransformerFactory.newInstance();
Source xslt = new StreamSource(getClass().getResource(xslResource).openStream());
Source xslt = new StreamSource(XmlTransformer.class.getResource(xslResource).openStream());
return factory.newTransformer(xslt);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ protected void setVersion(String version) throws IOException {

private void copyResourcesFolder(String resFolder, File outputDir) throws Exception {
List<Path> files;
URL partials = getClass().getResource(resFolder);
URL partials = AsciidocPreProcessMojo.class.getResource(resFolder);
try (FileSystem fs = FileSystems.newFileSystem(partials.toURI(), Collections.emptyMap());
Stream<Path> walk = Files.walk(fs.getPath(resFolder))) {
files = walk.filter(Files::isRegularFile)
.collect(Collectors.toList());
}
for(Path file : files) {
try(InputStream stream = getClass().getResourceAsStream(file.toString())) {
try(InputStream stream = AsciidocPreProcessMojo.class.getResourceAsStream(file.toString())) {
File dest = new File(outputDir, file.getFileName().toString());
Files.copy(stream, dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2024 3A Systems LLC.
* Copyright 2024-2026 3A Systems LLC.
*/

package org.openidentityplatform.doc.maven;
Expand Down Expand Up @@ -82,7 +82,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {

}

final URL nestedOpenBlockExt = getClass().getResource("/asciidoc/extenstions/nested-open-block.rb");
final URL nestedOpenBlockExt = AsciidocToPdfMojo.class.getResource("/asciidoc/extenstions/nested-open-block.rb");

executeMojo(
plugin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.selfservice.example;
Expand Down Expand Up @@ -89,7 +90,7 @@ private void registerCRESTServices() throws ResourceException {

private Handler buildHandler(String configResource) throws Exception {
ObjectMapper mapper = new ObjectMapper();
JsonValue json = new JsonValue(mapper.readValue(getClass().getResource(configResource), Map.class));
JsonValue json = new JsonValue(mapper.readValue(ExampleSelfServiceApplication.class.getResource(configResource), Map.class));

RequestHandler service = JsonAnonymousProcessServiceBuilder.newBuilder()
.withJsonConfig(json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
* Portions Copyrighted 2026 3A Systems, LLC.
*/

package org.forgerock.util.xml;
Expand Down Expand Up @@ -47,7 +48,7 @@ public InputSource resolveEntity(final String aPublicID, final String aSystemID)

if (sysid.toLowerCase().startsWith("jar://")) {
final String dtdname = sysid.substring(5);
final InputStream is = getClass().getResourceAsStream(dtdname);
final InputStream is = XMLHandler.class.getResourceAsStream(dtdname);
if (is != null) {
return new InputSource(is);
}
Expand Down
Loading