Class Util
java.lang.Object
ecmwf.common.ftpd.Util
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisplay(CurrentContext currentContext, BufferedReader in, int code, String tail) display.static voiddisplay(CurrentContext currentContext, File file, int code, String tail) Display.static voiddisplay(CurrentContext currentContext, String message, int code, String tail) Display.static Objectexec(Class<?> caller, CurrentContext currentContext, String request, boolean restricted) Exec.static Class<?> getClass(CurrentContext currentContext, String command, boolean alias, boolean restricted) Gets the class.static StringgetMessageWithEOL(CurrentContext currentContext, String message) Gets the message with eol.static StringgetPath(CurrentContext currentContext, String path, boolean update, boolean file) Gets the path.static intParses the mode.static StringparseParameter(CurrentContext curCon, Class<?> command, String request) Parses the parameter.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
display
display.- Parameters:
currentContext- the current contextin- the incode- the codetail- the tail
-
display
Display.- Parameters:
currentContext- the current contextfile- the filecode- the codetail- the tail
-
display
Display.- Parameters:
currentContext- the current contextmessage- the messagecode- the codetail- the tail
-
exec
public static Object exec(Class<?> caller, CurrentContext currentContext, String request, boolean restricted) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Exec.- Parameters:
caller- the callercurrentContext- the current contextrequest- the requestrestricted- the restricted- Returns:
- the object
- Throws:
ClassNotFoundException- the class not found exceptionNoSuchMethodException- the no such method exceptionInstantiationException- the instantiation exceptionIllegalAccessException- the illegal access exceptionInvocationTargetException- the invocation target exception
-
getClass
public static Class<?> getClass(CurrentContext currentContext, String command, boolean alias, boolean restricted) throws ClassNotFoundException Gets the class.- Parameters:
currentContext- the current contextcommand- the commandalias- the aliasrestricted- the restricted- Returns:
- the class
- Throws:
ClassNotFoundException- the class not found exception
-
parseMode
Parses the mode.- Parameters:
mode- the mode- Returns:
- the int
- Throws:
NumberFormatException- the number format exception
-
parseParameter
Parses the parameter.- Parameters:
curCon- the cur concommand- the commandrequest- the request- Returns:
- the string
-
getPath
public static String getPath(CurrentContext currentContext, String path, boolean update, boolean file) throws FileNotFoundException Gets the path.- Parameters:
currentContext- the current contextpath- the pathupdate- the updatefile- the file- Returns:
- the path
- Throws:
FileNotFoundException- the file not found exception
-
getMessageWithEOL
Gets the message with eol.- Parameters:
currentContext- the current contextmessage- the message- Returns:
- the message with eol
-