Add ftp4j

This commit is contained in:
Izzel_Aliz 2018-06-12 14:49:51 +08:00
parent 4aabd95c59
commit 9148914873
12 changed files with 112 additions and 6 deletions

1
.gitignore vendored
View File

@ -22,3 +22,4 @@ hs_err_pid*
.gradle/4.3.1/ .gradle/4.3.1/
.idea .idea
target target
TabooLib.iml

View File

@ -10,9 +10,6 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compile.source>1.5</maven.compile.source>
<maven.compile.target>1.5</maven.compile.target>
<maven.compile.deprecation>off</maven.compile.deprecation>
</properties> </properties>
<build> <build>
<defaultGoal>clean install package</defaultGoal> <defaultGoal>clean install package</defaultGoal>
@ -33,8 +30,10 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version> <version>3.7.0</version>
<configuration> <configuration>
<source>8</source> <source>1.8</source>
<target>8</target> <target>1.8</target>
<showDeprecation>false</showDeprecation>
<useIncrementalCompilation>true</useIncrementalCompilation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

Binary file not shown.

View File

@ -0,0 +1 @@
9b5971848287cbe7b44cbd65030bb8a6

View File

@ -0,0 +1 @@
abd6a2ba75b142926052c4538611efda49e0b0e2

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>it.sauronsoftware</groupId>
<artifactId>ftp4j</artifactId>
<version>1.7.2</version>
<name>ftp4j</name>
</project>

View File

@ -0,0 +1 @@
c65d8fbb7a85cc5155f3ad9cddca4e90

View File

@ -0,0 +1 @@
c972043028bd8b4f5f0194708e04346204ee95e9

View File

@ -0,0 +1 @@
715cfdd442aaaf1af0b4c8ee10bfa74e

View File

@ -0,0 +1 @@
6337fb920f4b00fa9eeca55b2345322181a3ac32

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>it.sauronsoftware</groupId>
<artifactId>ftp4j</artifactId>
<versioning>
<release>1.7.2</release>
<versions>
<version>1.7.2</version>
</versions>
<lastUpdated>20120412000000</lastUpdated>
</versioning>
</metadata>

View File

@ -5,9 +5,35 @@ import com.ilummc.tlib.bean.Property;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import java.util.concurrent.TimeUnit;
@TConfig(name = "cfg.yml", charset = "GBK") @TConfig(name = "cfg.yml", charset = "GBK")
public class ExampleMain extends JavaPlugin { public class ExampleMain extends JavaPlugin {
public static void main(String[] args) {
MemoryMXBean bean = ManagementFactory.getMemoryMXBean();
System.out.println(bean.getHeapMemoryUsage().toString());
System.out.println(bean.getNonHeapMemoryUsage().toString());
for (int i = 0; i < 10; i++) {
for (GarbageCollectorMXBean mxBean : ManagementFactory.getGarbageCollectorMXBeans()) {
System.out.println(mxBean.getName());
System.out.println(mxBean.getCollectionCount());
System.out.println(mxBean.getCollectionTime());
for (String s : mxBean.getMemoryPoolNames()) {
System.out.println(s);
}
System.out.println(mxBean.getObjectName().toString());
}
System.gc();
}
for (String s : ManagementFactory.getRuntimeMXBean().getInputArguments()) {
System.out.println(s);
}
}
private Property<Boolean> update = Property.of(false); private Property<Boolean> update = Property.of(false);
@Override @Override
@ -31,4 +57,58 @@ public class ExampleMain extends JavaPlugin {
} }
} }
private static class CD {
final long start, period;
final TimeUnit unit;
final Runnable onStart, onFinish, onTimer;
CD(long start, long period, TimeUnit unit, Runnable onStart, Runnable onFinish, Runnable onTimer) {
this.start = start;
this.period = period;
this.unit = unit;
this.onStart = onStart;
this.onFinish = onFinish;
this.onTimer = onTimer;
}
public static void main(String[] args) {
CD.builder().setOnStart(() -> {
}).setOnFinish(() -> {
}).setOnTimer(1000, TimeUnit.MILLISECONDS, () -> {
}).build();
}
public static CdBuilder builder() {
return new CdBuilder();
}
private static class CdBuilder {
private long start, period;
private TimeUnit unit;
private Runnable onStart, onFinish, onTimer;
public CdBuilder setOnStart(Runnable runnable) {
this.onStart = runnable;
return this;
}
public CdBuilder setOnFinish(Runnable runnable) {
this.onFinish = runnable;
return this;
}
public CdBuilder setOnTimer(long period, TimeUnit timeUnit, Runnable runnable) {
this.period = period;
this.unit = timeUnit;
this.onTimer = runnable;
return this;
}
public CD build() {
return new CD(start, period, unit, onStart, onFinish, onTimer);
}
}
}
} }