CopyPastor

Detecting plagiarism made easy.

Score: 0.9815305646557313; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2025-06-26
by Shivendra Pandey

Original Post

Original - Posted on 2025-06-26
by Shivendra Pandey



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I found 2 solutions
``` solution1: using Configurations ```
``` Configurations configs = new Configurations(); Configuration config = configs.properties(new File("src/main/resources/xyz.properties")); ```
``` solution2: using ClassLoader ```
``` ClassLoader classLoader = ClassLoader.getSystemClassLoader(); Properties prop = new Properties(); prop.load(classLoader.getResourceAsStream("resources/xyz.properties")); ```
build your project and execute maven generated jar \[\*\*/target/\*-0.0.1-SNAPSHOT.jar\] `java -jar *-0.0.1-SNAPSHOT.jar`
I found 2 solutions
``` solution1: using Configurations ```
``` Configurations configs = new Configurations(); Configuration config = configs.properties(new File("src/main/resources/xyz.properties")); ```
``` solution2: using ClassLoader ```
``` ClassLoader classLoader = ClassLoader.getSystemClassLoader(); Properties prop = new Properties(); prop.load(classLoader.getResourceAsStream("resources/xyz.properties")); ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;