com.ptc.wvs.common.util
Class Utilities

java.lang.Object
  extended bycom.ptc.wvs.common.util.Utilities

public class Utilities
extends Object

Utils which are used by both server and client

Supported API: false


Constructor Summary
Utilities()
           
 
Method Summary
static String addPathToFile(String path, String fileName)
          Appends the filename to the path inserting the System delimiter

Supported API: false
static String addPathToFile(String path, String fileName, String delimiter)
          Appends the filename to the path inserting the delimiter

Supported API: false
static String convertEmbedToObject(String embed, String objParams, String addParams)
          convert a String representation of an embed tag to an object tag.
static byte[] getDataFromFile(String filename)
          Extracts a byte array containing all data in specified file

Supported API: false
static int getFileLength(String filename)
          Returns the number of bytes in a file

Supported API: false
static String getRelativeURL(String fullURL)
          remove the server:port etc from the start of the url

Supported API: false
static boolean mkdir(String directory)
          Make a directory

Supported API: false
static String SandR(String in, String s, String r)
          Substitutes one string for another in an input String

Supported API: false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

addPathToFile

public static String addPathToFile(String path,
                                   String fileName,
                                   String delimiter)
Appends the filename to the path inserting the delimiter

Supported API: false

Parameters:
path - Path to file
delimiter - The delimiter to insert
Returns:
String Full path name

addPathToFile

public static String addPathToFile(String path,
                                   String fileName)
Appends the filename to the path inserting the System delimiter

Supported API: false

Parameters:
path - Path to file
Returns:
String Full path name

SandR

public static String SandR(String in,
                           String s,
                           String r)
Substitutes one string for another in an input String

Supported API: false

Parameters:
in - Input string
s - Substitution string
r - Replace string
Returns:
String Resulting string

getFileLength

public static int getFileLength(String filename)
Returns the number of bytes in a file

Supported API: false

Parameters:
filename - File to be sized
Returns:
int The length, -1 if file does not exist

getDataFromFile

public static byte[] getDataFromFile(String filename)
Extracts a byte array containing all data in specified file

Supported API: false

Parameters:
filename - File whos dat is to be extracted
Returns:
btyes[] Resulting data

mkdir

public static boolean mkdir(String directory)
Make a directory

Supported API: false

Parameters:
directory - The directory to make
Returns:
boolean True if a directory now exists

getRelativeURL

public static String getRelativeURL(String fullURL)
remove the server:port etc from the start of the url

Supported API: false

Returns:
String relative URL

convertEmbedToObject

public static String convertEmbedToObject(String embed,
                                          String objParams,
                                          String addParams)
convert a String representation of an embed tag to an object tag. this deals with the embed and object tags used for ProductView

Supported API: false

Parameters:
embed - the embed tag
objParams - parameters to add to the object tag
addParams - additional data to add inside the object
Returns:
The object tag String