Rational Developer for Power Systems Software
V8.0

com.ibm.etools.iseries.projects.core
Class IBMiProjectResourceNameUtil

java.lang.Object
  extended by com.ibm.etools.iseries.projects.core.IBMiProjectResourceNameUtil

public class IBMiProjectResourceNameUtil
extends Object

Utility methods.


Field Summary
static String copyright
           
 
Constructor Summary
IBMiProjectResourceNameUtil()
           
 
Method Summary
static String escapeFileName(String name)
          Gets the escaped name for the specified name.
static boolean isEscaped(String name)
          Checks if a name contains any escape sequences.
static boolean isUnescaped(String name)
          Checks if a name contains unescaped characters ignoring any escape sequences already present in the name.
static String unEscapeFileName(String name)
          Reverses what was done in the escapeFileName(String name) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static String copyright
Constructor Detail

IBMiProjectResourceNameUtil

public IBMiProjectResourceNameUtil()
Method Detail

isEscaped

public static boolean isEscaped(String name)
Checks if a name contains any escape sequences.

Parameters:
name - the name to check
Returns:
true if the name contains at least one escape sequence

isUnescaped

public static boolean isUnescaped(String name)
Checks if a name contains unescaped characters ignoring any escape sequences already present in the name.

Parameters:
name - the name to check
Returns:
true if the name contains at least one unescaped character

escapeFileName

public static String escapeFileName(String name)
Gets the escaped name for the specified name. This method converts illegal filename characters to a #nnn escape sequence where nnn is the decimal value for the character. It ignores existing escape sequences. Since \ and / are among the characters that are escaped one should only escape file names and not full path names.

Parameters:
name - the name to escape
Returns:
the escaped name. If the name did not require escaping then the original name is returned.

unEscapeFileName

public static String unEscapeFileName(String name)
Reverses what was done in the escapeFileName(String name) method. This replaces all occurrences of known escape sequences with their character counterparts. If the name contains no such sequences then the original name is returned.

Parameters:
name - the name to "unescape".
Returns:
the unescaped name

Rational Developer for Power Systems Software
V8.0

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.