Checkout physical file from the vault to the specified local directory.

Namespace:  Aras.IOM
Assembly:  IOM (in IOM.dll) Version: 11.0.0.6296

Syntax

C#
public Item checkout(
	string dir
)
Visual Basic (Declaration)
Public Function checkout ( _
	dir As String _
) As Item
J#
public Item checkout(
	String dir
)
JScript
public function checkout(
	dir : String
) : Item

Parameters

dir
Type: System..::.String
Path to the directory to which the file will be checked out. The path can be either relative to the location of the client executable or absolute.

Return Value

If checkout has failed the method returns an "error" item; otherwise this is returned.

Remarks

There are several rules about how the method could be used: a) the method could be invoked only on client; b) it's assumed that the item is of type 'File'; c) the item must have property 'filename' set. It's possible to checkout the same file multiple times. If the same file is downloaded into the same directory more than once, latest version of the file overwrites the previous one. If checkout succeeded, the method sets property 'checkedout_path' to the full path of the checked out file (this is only the run-time setting, so no update will be done in the corresponding File's record in the Innovator database.)
If physical file of the item was checked out it doesn't mean that it will be send back to the server when the item is applied. In order to check-in physical file back to the server one should call attachPhysicalFile on the item prior to calling apply on it or its parent item.

Examples

C#
CopyC#
...
Item files = myItem.getItemsByXPath( "/Item[@type='File']" );
int fcount = files.getItemCount();
for( int i = 0; i < fcount; i++ )
{
  Item file = files.getItemByIndex( i );
  Item result = file.checkout( "c:\\temp" );
  if( result.isError() )
  {
    Console.WriteLine( string.Format( "Failed to checkout file '{0}'", file.getProperty( "filename" ) ) );
  }
}
...

Exceptions

ExceptionCondition
System..::.Exception
  • The instance doesn't represent a single item.
  • Item is not of type 'File'.
  • Item doesn't have ID set.
  • The item was never stored on server (i.e. has 'isNew' attribute set to '1').
System.IO..::.IOExceptionFile download failed.

See Also