mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-05 23:22:47 +00:00
Fixed issue launching client specific server
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.l2jserver.service.core.vfs;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -67,16 +68,27 @@ public class Java7VFSService extends
|
||||
|
||||
@Override
|
||||
public Path resolve(String path) {
|
||||
return resolve(Paths.get(path));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path resolve(Path path) {
|
||||
log.debug("Resolving file {}", path);
|
||||
return root.resolve(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path resolveDataFile(String path) {
|
||||
return resolveDataFile(Paths.get(path));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path resolveDataFile(Path path) {
|
||||
log.debug("Resolving data file {}", path);
|
||||
return dataRoot.resolve(path);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doStop() throws ServiceStopException {
|
||||
root = null;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.l2jserver.service.core.vfs;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -63,7 +64,7 @@ public class TrueZipVFSService extends
|
||||
|
||||
@Override
|
||||
protected void doStart() throws ServiceStartException {
|
||||
root = new TPath(config.getRoot().toAbsolutePath());
|
||||
root = new TPath(config.getRoot().normalize());
|
||||
log.debug("Root path is {}", root);
|
||||
|
||||
dataRoot = root.resolve(config.getDataPath());
|
||||
@@ -72,12 +73,22 @@ public class TrueZipVFSService extends
|
||||
|
||||
@Override
|
||||
public Path resolve(String path) {
|
||||
return resolve(Paths.get(path));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path resolve(Path path) {
|
||||
log.debug("Resolving file {}", path);
|
||||
return root.resolve(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path resolveDataFile(String path) {
|
||||
return resolveDataFile(Paths.get(path));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path resolveDataFile(Path path) {
|
||||
log.debug("Resolving data file {}", path);
|
||||
return dataRoot.resolve(path);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,18 @@ public interface VFSService extends Service {
|
||||
* @return the resolved file. Will return null if could not resolve.
|
||||
*/
|
||||
Path resolve(String path);
|
||||
|
||||
/**
|
||||
* Resolves an file. If the file cannot be resolved, null will be returned.
|
||||
* <p>
|
||||
* Please note that even if the file DOES NOT exists a valid object will be
|
||||
* returned.
|
||||
*
|
||||
* @param path
|
||||
* the file path
|
||||
* @return the resolved file. Will return null if could not resolve.
|
||||
*/
|
||||
Path resolve(Path path);
|
||||
|
||||
/**
|
||||
* Resolves an file inside the data storage file system. If the file cannot
|
||||
@@ -51,4 +63,17 @@ public interface VFSService extends Service {
|
||||
* @return the resolved file. Will return null if could not resolve.
|
||||
*/
|
||||
Path resolveDataFile(String path);
|
||||
|
||||
/**
|
||||
* Resolves an file inside the data storage file system. If the file cannot
|
||||
* be resolved, null will be returned.
|
||||
* <p>
|
||||
* Please note that, differently from {@link #resolve(String)}, if the file
|
||||
* does not exists, <code>null</code> is returned.
|
||||
*
|
||||
* @param path
|
||||
* the file path
|
||||
* @return the resolved file. Will return null if could not resolve.
|
||||
*/
|
||||
Path resolveDataFile(Path path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user