Try this one.
[highlight=java]
// Specify pathname or parent/child. If both specified, pathname
// takes precedence. Renames a file specified by pathname or
// parent/child to the file specified by destpathname or
// destparent/destchild. Returns true if rename succeeds.
// Uses java.io.File to do the work.
public static final void renameTo (IData pipeline)
throws ServiceException
{
// — <<IS-START(renameTo)>> —
// @sigtype java 3.5
// [i] field:0:required pathname
// [i] field:0:required parent
// [i] field:0:required child
// [i] field:0:required destpathname
// [i] field:0:required destparent
// [i] field:0:required destchild
// [o] field:0:required result
IDataCursor pipelineCursor = pipeline.getCursor();
String pathname = IDataUtil.getString( pipelineCursor, “pathname” );
String parent = IDataUtil.getString( pipelineCursor, “parent” );
String child = IDataUtil.getString( pipelineCursor, “child” );
String destpathname = IDataUtil.getString( pipelineCursor, “destpathname” );
String destparent = IDataUtil.getString( pipelineCursor, “destparent” );
String destchild = IDataUtil.getString( pipelineCursor, “destchild” );
java.io.File f = null;
java.io.File dest = null;
if(pathname != null)
{
f = new java.io.File(pathname);
}
else if(parent != null && child != null)
{
f = new java.io.File(parent, child);
}
if(destpathname != null)
{
dest = new java.io.File(destpathname);
}
else if(destparent != null && destchild != null)
{
dest = new java.io.File(destparent, destchild);
}
IDataUtil.put( pipelineCursor, “result”, (f.renameTo(dest)?“true”:“false”));
pipelineCursor.destroy();
// — <> —
}
[/highlight]
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods