|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpl.mipl.phx.pgs.Utils
public class Utils
Some useful Phx utilities
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static String |
chooseFiletype(org.jbpm.graph.exe.ExecutionContext executionContext)
Choose one of the fei filetypes from the context, if none found return null |
static void |
copyCompleteFile(String source,
String target)
Copy one file to another |
static void |
copyFile(String source,
String target)
Copy file |
static boolean |
deleteFile(String dir,
String filename)
Delete file |
static String |
expandPhxUpfVars(String value,
String varStart,
String varEnd,
org.jbpm.graph.exe.ExecutionContext executionContext)
Expands all context variables in the given string. |
static String |
getApid(String filename)
|
static String |
getBareFilename(String filename)
Return the filename substring before version which is at character 26 |
static String |
getInstrument(String filename)
Determine what instrument this edr is from S == "ssi" O == "om" R == "rac" A == "ra" F == "afm" // MECA-AFM P == "tecp" // MECA-TECP W == "wce" // MECA-WCE X == "misc" // MECA-misc else retrun "unk" |
static String |
getInstrumentName(String filename)
Returns full instrument name of an EDR S == "SURFACE STEREO IMAGER" R == "ROBOTIC ARM CAMERA" |
static String |
getNewFilename(String filename,
String replace,
boolean pds)
Create filenames for all the products Replace characters at index 5,6,7 (zero-based), with the string 'replace' This is used to generate filenames for the different product types |
static String |
getNextVersion(String filename)
Look at the file on disk and return the latest version. |
static short |
getObservationType(String filename)
|
static String |
getProductLogName(String filename)
Construct a log filename for the given product |
static String |
getVersion(String filename)
|
static List |
initPhxLoggers(org.jbpm.graph.exe.ExecutionContext executionContext,
String pdName,
List phxLoggers)
Set up phx logging and log files |
static boolean |
isMosaic(String filename)
|
static boolean |
isStereo(String filename)
|
static void |
logPhx(List phxLoggers,
Level level,
String msg)
Write log messages to all phxLoggers. |
static void |
logPhx(List phxLoggers,
Level level,
String msg,
Throwable t)
|
static void |
moveFile(String source,
String target)
|
static String |
parseSol(String filename)
Return SOL from the filename (3 chars, index 2-4) |
static String |
parseType(String filename)
Return type (epic) from the filename (1 char: index 1) |
static void |
publishToFei(String filetype,
String filename,
String rename,
UPF upf)
Add the file to fei |
static void |
publishToOss(String fullname,
String oss_root,
String rename)
Copy the given file to the Oss. |
static String[] |
updateOutfilename(String[] command,
String next)
Update the version number of the out file parameter in this command |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static String getNewFilename(String filename, String replace, boolean pds)
filename
- replace
-
public static String getBareFilename(String filename)
filename
- may include a path
public static String getVersion(String filename)
filename
-
public static String getProductLogName(String filename) throws Exception
filename
- may include a path
Exception
public static String getNextVersion(String filename) throws PhxFilenameException
filename
- may include a path
PhxFilenameException
public static String expandPhxUpfVars(String value, String varStart, String varEnd, org.jbpm.graph.exe.ExecutionContext executionContext) throws PhxUpfException
value
-
PhxUpfException
public static String[] updateOutfilename(String[] command, String next) throws PhxUpfException
command
- next
-
PhxUpfException
public static boolean deleteFile(String dir, String filename) throws Exception
dir
- filename
-
Exception
public static void copyFile(String source, String target) throws Exception
source
- target
-
Exception
public static void copyCompleteFile(String source, String target) throws Exception
source
- target
-
Exception
public static void moveFile(String source, String target) throws Exception
source
- target
-
Exception
public static String parseType(String filename)
filename
-
public static String parseSol(String filename)
filename
-
public static String getInstrument(String filename)
filename
-
public static String getInstrumentName(String filename)
filename
-
public static void publishToOss(String fullname, String oss_root, String rename) throws Throwable
fullname
- filename including pathrename
- filename only, if not null than file will have this name
on the oss, otherwise keeps original name
Throwable
public static void publishToFei(String filetype, String filename, String rename, UPF upf) throws Throwable
path
- name
-
Throwable
public static List initPhxLoggers(org.jbpm.graph.exe.ExecutionContext executionContext, String pdName, List phxLoggers) throws Exception
Exception
public static String chooseFiletype(org.jbpm.graph.exe.ExecutionContext executionContext) throws Exception
executionContext
-
Exception
public static String getApid(String filename)
filename
-
public static boolean isStereo(String filename)
filename
-
public static boolean isMosaic(String filename)
filename
-
public static short getObservationType(String filename)
filename
-
public static void logPhx(List phxLoggers, Level level, String msg)
level
- msg
- public static void logPhx(List phxLoggers, Level level, String msg, Throwable t)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |