Package org.tmatesoft.svn.core.wc2
Class SvnImport
- java.lang.Object
-
- org.tmatesoft.svn.core.wc2.SvnOperation<T>
-
- org.tmatesoft.svn.core.wc2.SvnReceivingOperation<SVNCommitInfo>
-
- org.tmatesoft.svn.core.wc2.AbstractSvnCommit
-
- org.tmatesoft.svn.core.wc2.SvnImport
-
- All Implemented Interfaces:
ISvnObjectReceiver<SVNCommitInfo>,ISvnOperationOptionsProvider
public class SvnImport extends AbstractSvnCommit
Imports file or directorysourceinto repository directory defined in operation'stargetat HEAD revision. If some components of operations'targetdoes not exist, then creates parent directories as necessary. Thetargetof the operation should represent URL. If the caller'sevent handleris not null it will be called as the import progresses withSVNEventAction.COMMIT_ADDEDaction. If the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETEDevent action. If non-null,revisionPropertiesholds additional, custom revision properties (Stringnames mapped toSVNPropertyValuevalues) to be set on the new revision. This table cannot contain any standard Subversion properties.commitHandlerwill be asked for a commit log message. IfdepthisSVNDepth.EMPTY, imports justsourceand nothing below it. IfSVNDepth.FILES, importssourceand any file children ofsource. IfSVNDepth.IMMEDIATES, importssource, any file children, and any immediate subdirectories (but nothing underneath those subdirectories). IfSVNDepth.INFINITY, importssourceand everything under it fully recursively.SvnOperation.run()method returnsSVNCommitInfoinformation about the new committed revision. This method throws SVNException in the following cases:- exception with
SVNErrorCode.ENTRY_NOT_FOUNDerror code - ifsourcedoes not exist - exception with
SVNErrorCode.ENTRY_EXISTSerror code - if operation'stargetalready exists andsourceis a file - exception with
SVNErrorCode.CL_ADM_DIR_RESERVEDerror code - if trying to import an item with a reserved SVN name (like'.svn'or'_svn')
- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSvnImport(SvnOperationFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureArgumentsAreValid()ISVNFileFiltergetFileFilter()java.io.FilegetSource()Returns import operation's source.booleanisApplyAutoProperties()Gets whether to enable automatic propertiesbooleanisChangesWorkingCopy()Gets whether the operation changes working copybooleanisForce()Gets whether to ignore files of unknown node types or not.booleanisUseGlobalIgnores()Gets whether to adds files or directories that match ignore patterns.voidsetApplyAutoProperties(boolean applyAutoProperties)Sets whether to enable automatic propertiesvoidsetFileFilter(ISVNFileFilter fileFilter)voidsetForce(boolean force)Sets whether to ignore files of unknown node types or not.voidsetSource(java.io.File source)Sets source of the import.voidsetUseGlobalIgnores(boolean useGlobalIgnores)Sets whether to adds files or directories that match ignore patterns.-
Methods inherited from class org.tmatesoft.svn.core.wc2.AbstractSvnCommit
getCommitHandler, getCommitMessage, getRevisionProperties, setCommitHandler, setCommitMessage, setRevisionProperties, setRevisionProperty
-
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnReceivingOperation
first, getReceiver, initDefaults, last, receive, run, setReceiver
-
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnOperation
addTarget, cancel, ensureEnoughTargets, ensureHomohenousTargets, getApplicableChangelists, getAuthenticationManager, getCanceller, getDepth, getEventHandler, getFirstTarget, getMaximumTargetsCount, getMinimumTargetsCount, getOperationalWorkingCopy, getOperationFactory, getOptions, getRepositoryPool, getRevision, getSqliteJournalMode, getTargets, hasFileTargets, hasLocalTargets, hasRemoteTargets, isCancelled, isSleepForTimestamp, isUseParentWcFormat, needsHomohenousTargets, run, setApplicalbeChangelists, setDepth, setRevision, setSingleTarget, setSleepForTimestamp, setSqliteJournalMode
-
-
-
-
Constructor Detail
-
SvnImport
protected SvnImport(SvnOperationFactory factory)
-
-
Method Detail
-
isApplyAutoProperties
public boolean isApplyAutoProperties()
Gets whether to enable automatic properties- Returns:
trueif automatic properties should be enabled, otherwisefalse
-
setApplyAutoProperties
public void setApplyAutoProperties(boolean applyAutoProperties)
Sets whether to enable automatic properties- Parameters:
applyAutoProperties-trueif automatic properties should be enabled, otherwisefalse
-
getSource
public java.io.File getSource()
Returns import operation's source.- Returns:
- return source of the import operation
- See Also:
getSource()
-
setSource
public void setSource(java.io.File source)
Sets source of the import. Ifsourceis a directory, the contents of that directory are imported directly into the directory identified bytarget. Note that the directory itself is not imported -- that is, the base name of directory is not part of the import. Ifsourceis a file, then the parent of operation'stargetis the directory receiving the import. The base name ofsourceis the filename in the repository. In this case if this filename already exists, throwsSVNException.- Parameters:
source- source of the import operation
-
isForce
public boolean isForce()
Gets whether to ignore files of unknown node types or not.- Returns:
trueif files of unknown node types should be ignored, otherwisefalse- See Also:
setForce(boolean)
-
setForce
public void setForce(boolean force)
Sets whether to ignore files of unknown node types or not. Unversionable items such as device files and pipes are ignored ifforceistrue.- Parameters:
force-trueif files of unknown node types should be ignored, otherwisefalse
-
isUseGlobalIgnores
public boolean isUseGlobalIgnores()
Gets whether to adds files or directories that match ignore patterns.- Returns:
trueadds files or directories that match ignore patterns, otherwisefalse
-
setUseGlobalIgnores
public void setUseGlobalIgnores(boolean useGlobalIgnores)
Sets whether to adds files or directories that match ignore patterns.- Parameters:
useGlobalIgnores-trueadds files or directories that match ignore patterns, otherwisefalse
-
ensureArgumentsAreValid
protected void ensureArgumentsAreValid() throws SVNException- Overrides:
ensureArgumentsAreValidin classSvnOperation<SVNCommitInfo>- Throws:
SVNException
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy- Overrides:
isChangesWorkingCopyin classSvnOperation<SVNCommitInfo>- Returns:
trueif the operation changes the working copy, otherwisefalse
-
getFileFilter
public ISVNFileFilter getFileFilter()
-
setFileFilter
public void setFileFilter(ISVNFileFilter fileFilter)
-
-