Skip to content

Commit 868846c

Browse files
committed
v1.4
1 parent 50164b7 commit 868846c

14 files changed

+61
-117
lines changed

pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.javaezlib</groupId>
88
<artifactId>JavaEZ</artifactId>
9-
<version>1.3</version>
9+
<version>1.4</version>
1010
<description>A simplification library to make Java easier for newcomers.</description>
1111
<name>${project.groupId}:${project.artifactId}</name>
1212
<packaging>jar</packaging>
@@ -19,9 +19,9 @@
1919
</licenses>
2020
<developers>
2121
<developer>
22-
<name>RedstoneBoy0509</name>
23-
<email>redstoneboy0509@gmail.com</email>
24-
<url>redstoneboy0509.github.io</url>
22+
<name>Red050911</name>
23+
<email>javaezlib@gmail.com</email>
24+
<url>red050911.github.io</url>
2525
<roles>
2626
<role>Main developer</role>
2727
</roles>

src/main/java/io/github/javaezlib/javaez/JavaEZ.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class JavaEZ {
1717
* The current version of JavaEZ.
1818
* @since 1.1
1919
*/
20-
public static final String VERSION = "1.3";
20+
public static final String VERSION = "1.4";
2121

2222
/**
2323
* Prints info about your version of JavaEZ
@@ -55,7 +55,7 @@ public static String getLatestVersion() {
5555
*/
5656
public static List<String> getVersions() {
5757
try {
58-
URL url = new URL("https://gist.githubusercontent.com/RedstoneBoy0509/fb10258f9ae7d858f94b8cbaa651548f/raw/");
58+
URL url = new URL("https://gist.githubusercontent.com/Red050911/fb10258f9ae7d858f94b8cbaa651548f/raw/");
5959
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
6060
List<String> list = new ArrayList<>();
6161
String line;

src/main/java/io/github/javaezlib/javaez/JavaEZ.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/backend/BackendVariableContext.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/backend/ErrorSystem.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/backend/package-info.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/extensions/Core.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/extensions/Files.java

+54
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,58 @@ public static void writeLine(String line) {
113113
}
114114
}
115115

116+
/**
117+
* Makes a file
118+
* @param path Where to create this file
119+
* @since 1.4
120+
*/
121+
public static void makeFile(String path) {
122+
File file = new File(path);
123+
if(file.exists()) {
124+
ErrorSystem.handleError("This file already exists! Maybe a folder is there with the same name?");
125+
} else {
126+
try {
127+
if(!file.createNewFile()) ErrorSystem.handleError("We couldn't create the file. Maybe the path was wrong?");
128+
} catch (Exception e) {
129+
ErrorSystem.handleError("We couldn't create the file. Maybe the path was wrong?");
130+
}
131+
}
132+
}
133+
134+
/**
135+
* Makes a folder
136+
* @param path Where to create this file
137+
* @since 1.4
138+
*/
139+
public static void makeFolder(String path) {
140+
File file = new File(path);
141+
if(file.exists()) {
142+
ErrorSystem.handleError("This folder already exists! Maybe a file is there with the same name?");
143+
} else {
144+
try {
145+
if(!file.mkdirs()) ErrorSystem.handleError("We couldn't create the folder. Maybe the path was wrong?");
146+
} catch (Exception e) {
147+
ErrorSystem.handleError("We couldn't create the folder. Maybe the path was wrong?");
148+
}
149+
}
150+
}
151+
152+
/**
153+
* Trashes a file or folder.
154+
* @param path Path of the file to trash
155+
* @since 1.4
156+
*/
157+
public static void trashFile(String path) {
158+
File file = new File(path);
159+
if(!file.exists()) {
160+
ErrorSystem.handleError("The file/folder doesn't exist.");
161+
} else {
162+
try {
163+
if(!file.delete()) ErrorSystem.handleError("We couldn't trash the file/folder. Maybe the path was wrong?");
164+
} catch (Exception ex) {
165+
ErrorSystem.handleError("We couldn't trash the file/folder. Maybe the path was wrong?");
166+
}
167+
}
168+
}
169+
116170
}

src/main/java/io/github/javaezlib/javaez/extensions/Files.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/extensions/System.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static String whoIsUsingThePC() {
6060
*/
6161
public static void lockMyPC() {
6262
if(!whatsMyOS().toLowerCase().contains("win")) {
63-
ErrorSystem.handleError("You are not on Windows!");
63+
ErrorSystem.handleError("You are not on Windows! PCs can only be locked on Windows.");
6464
return;
6565
}
6666
try {

src/main/java/io/github/javaezlib/javaez/extensions/System.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/extensions/Threads.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/extensions/package-info.java.asc

-11
This file was deleted.

src/main/java/io/github/javaezlib/javaez/package-info.java.asc

-11
This file was deleted.

0 commit comments

Comments
 (0)