org.eclipse.emf.ant.util
Class Util
java.lang.Object
org.eclipse.emf.ant.util.Util
- public class Util
- extends Object
Utility classes with generic methods that may be used by more than one task.
- Since:
- 2.1.0
Constructor Summary |
Util()
|
Method Summary |
static int |
removeVersion(File parentDir)
Removes the version number of all the subdirectories of a given directory.
|
static void |
writeFile(File file,
String content)
Writes the given content to the specifed file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Util
public Util()
removeVersion
public static int removeVersion(File parentDir)
- Removes the version number of all the subdirectories of a given directory.
The expected format of the directories name is _ where version
has at least from 1 to 4 fields, the first 3 being digits. Examples:
foo_2, foo_2.1, foo_2.1.0, foo_2.1.0.a,
- Parameters:
parentDir
- the parent of the directories that will have the version removed
- Returns:
- the number of changed directories
writeFile
public static void writeFile(File file,
String content)
throws IOException
- Writes the given content to the specifed file.
- Parameters:
file
- The file to be written or overwritten.content
-
- Throws:
IOException