Skip to content

Commit 499aec3

Browse files
author
amdegregorio
committed
updates to simplify example
1 parent 66c9249 commit 499aec3

3 files changed

Lines changed: 1 addition & 94 deletions

File tree

‎core-java/src/main/java/com/baeldung/jar/Dimensioner.java‎

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
package com.baeldung.jar;
22

3-
import java.io.IOException;
4-
import java.util.List;
5-
63
public class JarExample {
7-
private static final String DIMENSION_FILE = "/dimensions.txt";
84

95
public static void main(String[] args) {
10-
String inputType = System.getProperty("input");
11-
if (inputType != null && inputType.equalsIgnoreCase("file")) {
12-
Dimensioner dimensioner = new Dimensioner();
13-
try {
14-
List<Rectangle> rectangles = dimensioner.loadFromFile(DIMENSION_FILE);
15-
rectangles.forEach(rectangle -> {
16-
rectangle.printArea();
17-
rectangle.printPerimeter();
18-
});
19-
} catch (IOException e) {
20-
System.err.println("Exception loading dimensions");
21-
}
22-
} else if (args.length > 0) {
23-
int length = Integer.valueOf(args[0]);
24-
int width = (args.length > 1) ? Integer.valueOf(args[1]) : Integer.valueOf(args[0]);
25-
Rectangle rectangle = new Rectangle(length, width);
26-
rectangle.printArea();
27-
rectangle.printPerimeter();
28-
}
6+
System.out.println("Hello Baeldung Reader!");
297
}
308

319
}

‎core-java/src/main/java/com/baeldung/jar/Rectangle.java‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)