jbackup/src/main/java/org/jbundle/jbackup/destination/DebugDestination.java
public long addNextFile(SourceFile source)
	{
		String strPath = source.getFilePath();
		String strFilename = source.getFileName();
		long lTotalLength = 0;

		if (getFileLength)
		{
			byte rgBytes[] = new byte[8192];
			InputStream inStream = source.makeInStream();
			try	{
				while (true)
				{
					int iLength = rgBytes.length;
					iLength = inStream.read(rgBytes, 0, iLength);
					if (iLength <= 0)
						break;
					lTotalLength += iLength;
				}
			} catch (IOException ex)	{
				streamOut.println("Error on next file: " + ex.getMessage());
			}
		}
		streamOut.println("Filename: " + strFilename + " Path: " + strPath + " length: " + lTotalLength);
		return lTotalLength;
	}
public long addNextFile(SourceFile source)
	{
		String strPath = source.getFilePath();
		String strFilename = source.getFileName();
		long lTotalLength = 0;

		if (getFileLength)
		{
			byte rgBytes[] = new byte[8192];
			InputStream inStream = source.makeInStream();
			try	{
				while (true)
				{
					int iLength = rgBytes.length;
					iLength = inStream.read(rgBytes, 0, iLength);
					if (iLength <= 0)
						break;
					lTotalLength += iLength;
				}
			} catch (IOException ex)	{
				streamOut.println("Error on next file: " + ex.getMessage());
			}
		}
		streamOut.println("Filename: " + strFilename + " Path: " + strPath + " length: " + lTotalLength);
		return lTotalLength;
	}
public long addNextFile ( SourceFile source ) { String strPath = source . getFilePath ( ) ; String strFilename = source . getFileName ( ) ; long lTotalLength = 0 ; if ( getFileLength ) { byte rgBytes [ ] = new byte [ 8192 ] ; InputStream inStream = source . makeInStream ( ) ; try { while ( true ) { int iLength = rgBytes . length ; iLength = inStream . read ( rgBytes , 0 , iLength ) ; if ( iLength <= 0 ) break ; lTotalLength += iLength ; } } catch ( IOException ex ) { streamOut . println ( "Error on next file: " + ex . getMessage ( ) ) ; } } streamOut . println ( "Filename: " + strFilename + " Path: " + strPath + " length: " + lTotalLength ) ; return lTotalLength ; }
/*
Add this file to the destination.
Note: Only supply the file or the stream, not both. Supply the object that is easier, given
the source. This dual option is given to allow destinations that require File objects from
(such as FTP or HTTP) Having to write the inStream to a physical file before processing it.
@param file Source file.
@param inStream Source stream.
@param strpath Full path of the source file (including the filename).
@param strFilename Filename.
@param lStreamLength Length of the stream (-1 if unknown).
/ * Add this file to the destination . Note : Only supply the file or the stream not both . Supply the object that is easier given the source . This dual option is given to allow destinations that require File objects from ( such as FTP or HTTP ) Having to write the inStream to a physical file before processing it .