Java Code Examples for org.eclipse.core.resources.IContainer#setTeamPrivateMember()

The following examples show how to use org.eclipse.core.resources.IContainer#setTeamPrivateMember() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SyncFileChangeListener.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
protected void handleSVNDir(IContainer svnDir, int kind) {
	if((kind & IResourceDelta.ALL_WITH_PHANTOMS)!=0) {
		if(kind==IResourceDelta.ADDED) {
			// should this dir be made team-private? If it contains Entries then yes!
			IFile entriesFile = svnDir.getFile(new Path(SVNConstants.SVN_ENTRIES));

			if (entriesFile.exists() &&  !svnDir.isTeamPrivateMember()) {
				try {
					svnDir.setTeamPrivateMember(true);			
					if(Policy.DEBUG_METAFILE_CHANGES) {
						System.out.println("[svn] found a new SVN meta folder, marking as team-private: " + svnDir.getFullPath()); //$NON-NLS-1$
					}
				} catch(CoreException e) {
					SVNProviderPlugin.log(SVNException.wrapException(svnDir, Policy.bind("SyncFileChangeListener.errorSettingTeamPrivateFlag"), e)); //$NON-NLS-1$
				}
			}
		}
	}
}
 
Example 2
Source File: TeamPrivateListener.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * If it's a new SVN directory with the canonical child metafiles then mark it as team-private. 
 * Makr it is team private even when it is changed but not marked team private yet.
 * @param svnDir IContainer which is expected to be svn meta directory
 * @param kind resourceDelta kind of change
 * @return true when the folder folder really is svn meta directory
 */	
public boolean handleSVNDir(IContainer svnDir) {
	if (!svnDir.isTeamPrivateMember()) 
	{
		// should this dir be made team-private? If it contains Entries then yes!
		IFile entriesFile = svnDir.getFile(new Path(SVNConstants.SVN_ENTRIES));

		if (entriesFile.exists() &&  !svnDir.isTeamPrivateMember()) {
			try {
				svnDir.setTeamPrivateMember(true);			
				if(Policy.DEBUG_METAFILE_CHANGES) {
					System.out.println("[svn] found a new SVN meta folder, marking as team-private: " + svnDir.getFullPath()); //$NON-NLS-1$
				}
			} catch(CoreException e) {
				SVNProviderPlugin.log(SVNException.wrapException(svnDir, Policy.bind("SyncFileChangeListener.errorSettingTeamPrivateFlag"), e)); //$NON-NLS-1$
			}
		}
	}
	return svnDir.isTeamPrivateMember();
}