crwdns121955:0crwdne121955:0

crwdns121957:0:javadoc:crwdne121957:0

crwdns121959:0crwdne121959:0

crwdns121961:0crwdne121961:0

import org.spongepowered.api.asset.Asset;

Asset asset = plugin.getAsset("myfile.txt").get();

crwdns121963:0crwdne121963:0

import org.spongepowered.api.Sponge;

PluginContainer plugin = ...;

Asset asset = Sponge.getAssetManager().getAsset(plugin, "myfile.txt").get();

Tip

crwdns121965:0crwdne121965:0

Note

crwdns121967:0:javadoc:crwdne121967:0

crwdns121969:0crwdne121969:0

crwdns121971:0:javadoc:crwdne121971:0

import java.nio.file.Files;

if (Files.notExists(configPath)) {
    plugin.getAsset("default.conf").ifPresent(asset -> asset.copyToDirectory(configPath));
}

Note

crwdns121973:0crwdne121973:0