idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
33,200
public static SiblingCounter constant ( final int count ) { assert count > - 1 ; return new SiblingCounter ( ) { public int countSiblingsNamed ( Name childName ) { return count ; } } ; }
Create a sibling counter that always return the supplied count regardless of the name or node .
33,201
public static SiblingCounter alter ( final SiblingCounter counter , final int delta ) { assert counter != null ; return new SiblingCounter ( ) { public int countSiblingsNamed ( Name childName ) { int count = counter . countSiblingsNamed ( childName ) + delta ; return count > 0 ? count : 0 ; } } ; }
Creates a sibling counter that alters another counter by a constant value .
33,202
public RestWorkspaces getWorkspaces ( HttpServletRequest request , String repositoryName ) throws RepositoryException { assert request != null ; assert repositoryName != null ; RestWorkspaces workspaces = new RestWorkspaces ( ) ; Session session = getSession ( request , repositoryName , null ) ; for ( String workspaceN...
Returns the list of workspaces available to this user within the named repository .
33,203
public Response backupRepository ( ServletContext context , HttpServletRequest request , String repositoryName , BackupOptions options ) throws RepositoryException { final File backupLocation = resolveBackupLocation ( context ) ; Session session = getSession ( request , repositoryName , null ) ; String repositoryVersio...
Performs a repository backup .
33,204
public Response restoreRepository ( ServletContext context , HttpServletRequest request , String repositoryName , String backupName , RestoreOptions options ) throws RepositoryException { if ( StringUtil . isBlank ( backupName ) ) { throw new IllegalArgumentException ( "The name of the backup cannot be null" ) ; } File...
Restores a repository using an existing backup .
33,205
public void add ( T value ) { Lock lock = this . lock . writeLock ( ) ; try { lock . lock ( ) ; doAddValue ( value ) ; } finally { lock . unlock ( ) ; } }
Add a new value to these statistics .
33,206
public T getTotal ( ) { Lock lock = this . lock . readLock ( ) ; lock . lock ( ) ; try { return this . total ; } finally { lock . unlock ( ) ; } }
Get the aggregate sum of the values in the series .
33,207
public T getMaximum ( ) { Lock lock = this . lock . readLock ( ) ; lock . lock ( ) ; try { return this . maximum ; } finally { lock . unlock ( ) ; } }
Get the maximum value in the series .
33,208
public T getMinimum ( ) { Lock lock = this . lock . readLock ( ) ; lock . lock ( ) ; try { return this . minimum != null ? this . minimum : ( T ) this . math . createZeroValue ( ) ; } finally { lock . unlock ( ) ; } }
Get the minimum value in the series .
33,209
public int getCount ( ) { Lock lock = this . lock . readLock ( ) ; lock . lock ( ) ; try { return this . count ; } finally { lock . unlock ( ) ; } }
Get the number of values that have been measured .
33,210
public void reset ( ) { Lock lock = this . lock . writeLock ( ) ; lock . lock ( ) ; try { doReset ( ) ; } finally { lock . unlock ( ) ; } }
Reset the statistics in this object and clear out any stored information .
33,211
public static String getSubstitutedProperty ( String value , PropertyAccessor propertyAccessor ) { if ( value == null || value . trim ( ) . length ( ) == 0 ) return value ; StringBuilder sb = new StringBuilder ( value ) ; int startName = sb . indexOf ( CURLY_PREFIX ) ; if ( startName == - 1 ) return value ; while ( sta...
getSubstitutedProperty is called to perform the property substitution on the value .
33,212
private static List < String > split ( String str , String splitter ) { StringTokenizer tokens = new StringTokenizer ( str , splitter ) ; ArrayList < String > l = new ArrayList < > ( tokens . countTokens ( ) ) ; while ( tokens . hasMoreTokens ( ) ) { l . add ( tokens . nextToken ( ) ) ; } return l ; }
Split a string into pieces based on delimiters . Similar to the perl function of the same name . The delimiters are not included in the returned strings .
33,213
protected void checkFileNotExcluded ( String id , File file ) { if ( isExcluded ( file ) ) { String msg = JcrI18n . fileConnectorCannotStoreFileThatIsExcluded . text ( getSourceName ( ) , id , file . getAbsolutePath ( ) ) ; throw new DocumentStoreException ( id , msg ) ; } }
Utility method to ensure that the file is writable by this connector .
33,214
public static String filter ( String message ) { if ( message == null ) { return ( null ) ; } char content [ ] = new char [ message . length ( ) ] ; message . getChars ( 0 , message . length ( ) , content , 0 ) ; StringBuilder result = new StringBuilder ( content . length + 50 ) ; for ( int i = 0 ; i < content . length...
Filter the specified message string for characters that are sensitive in HTML . This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages .
33,215
public static Cookie [ ] parseCookieHeader ( String header ) { if ( ( header == null ) || ( header . length ( ) < 1 ) ) { return ( new Cookie [ 0 ] ) ; } ArrayList < Cookie > cookies = new ArrayList < Cookie > ( ) ; while ( header . length ( ) > 0 ) { int semicolon = header . indexOf ( ';' ) ; if ( semicolon < 0 ) { se...
Parse a cookie header into an array of cookies according to RFC 2109 .
33,216
public static String URLDecode ( String str , String enc ) { if ( str == null ) { return ( null ) ; } byte [ ] bytes = null ; try { if ( enc == null ) { bytes = str . getBytes ( ) ; } else { bytes = str . getBytes ( enc ) ; } } catch ( UnsupportedEncodingException uee ) { } return URLDecode ( bytes , enc ) ; }
Decode and return the specified URL - encoded String .
33,217
public static String URLDecode ( byte [ ] bytes , String enc ) { if ( bytes == null ) { return ( null ) ; } int len = bytes . length ; int ix = 0 ; int ox = 0 ; while ( ix < len ) { byte b = bytes [ ix ++ ] ; if ( b == '+' ) { b = ( byte ) ' ' ; } else if ( b == '%' ) { b = ( byte ) ( ( convertHexDigit ( bytes [ ix ++ ...
Decode and return the specified URL - encoded byte array .
33,218
public static boolean streamNotConsumed ( HttpServletRequest request ) { try { ServletInputStream servletInputStream = request . getInputStream ( ) ; return request . getContentLength ( ) != 0 && servletInputStream . available ( ) > 0 ; } catch ( IOException e ) { return false ; } }
Checks if the input stream of the given request is nor isn t consumed . This method is backwards - compatible with Servlet 2 . x as in Servlet 3 . x there is a isFinished method .
33,219
public static JcrAccessControlList defaultAcl ( AccessControlManagerImpl acm ) { JcrAccessControlList acl = new JcrAccessControlList ( "/" ) ; try { acl . principals . put ( SimplePrincipal . EVERYONE , new AccessControlEntryImpl ( SimplePrincipal . EVERYONE , acm . privileges ( ) ) ) ; } catch ( AccessControlException...
Creates default Access Control List .
33,220
public boolean hasPrivileges ( SecurityContext sc , Privilege [ ] privileges ) { for ( AccessControlEntryImpl ace : principals . values ( ) ) { if ( ace . getPrincipal ( ) . getName ( ) . equals ( SimplePrincipal . EVERYONE . getName ( ) ) ) { if ( ace . hasPrivileges ( privileges ) ) { return true ; } } if ( ace . get...
Tests privileges relatively to the given security context .
33,221
public Privilege [ ] getPrivileges ( SecurityContext context ) { ArrayList < Privilege > privs = new ArrayList < Privilege > ( ) ; for ( AccessControlEntryImpl ace : principals . values ( ) ) { if ( ace . getPrincipal ( ) . equals ( SimplePrincipal . EVERYONE ) ) { privs . addAll ( Arrays . asList ( ace . getPrivileges...
Lists all privileges defined by this access list for the given user .
33,222
private String username ( String username ) { return ( username . startsWith ( "<" ) && username . endsWith ( ">" ) ) ? username . substring ( 1 , username . length ( ) - 1 ) : username ; }
Removes brackets enclosing given user name
33,223
public NodeCache getNodeCache ( String workspaceName ) throws WorkspaceNotFoundException { NodeCache cache = overriddenNodeCachesByWorkspaceName . get ( workspaceName ) ; if ( cache == null ) { cache = repositoryCache . getWorkspaceCache ( workspaceName ) ; } return cache ; }
Get the NodeCache for the given workspace name . The result will either be the overridden value supplied in the constructor or the workspace cache from the referenced RepositoryCache .
33,224
public QueryContext with ( Schemata schemata ) { CheckArg . isNotNull ( schemata , "schemata" ) ; return new QueryContext ( context , repositoryCache , workspaceNames , overriddenNodeCachesByWorkspaceName , schemata , indexDefns , nodeTypes , bufferManager , hints , problems , variables ) ; }
Obtain a copy of this context except that the copy uses the supplied schemata .
33,225
public QueryContext with ( Problems problems ) { return new QueryContext ( context , repositoryCache , workspaceNames , overriddenNodeCachesByWorkspaceName , schemata , indexDefns , nodeTypes , bufferManager , hints , problems , variables ) ; }
Obtain a copy of this context except that the copy uses the supplied problem container .
33,226
public QueryContext with ( Map < String , Object > variables ) { return new QueryContext ( context , repositoryCache , workspaceNames , overriddenNodeCachesByWorkspaceName , schemata , indexDefns , nodeTypes , bufferManager , hints , problems , variables ) ; }
Obtain a copy of this context except that the copy uses the supplied variables .
33,227
public void scoreText ( String text , int factor , String ... keywords ) { if ( text != null && keywords != null ) { String lowercaseText = text . toLowerCase ( ) ; for ( String keyword : keywords ) { if ( keyword == null ) continue ; String lowercaseKeyword = keyword . toLowerCase ( ) ; int index = 0 ; while ( true ) ...
Increment the score if the given text contains any of the supply keywords .
33,228
protected String removeUnusedPredicates ( String expression ) { assert expression != null ; java . util . regex . Matcher matcher = UNUSABLE_PREDICATE_PATTERN . matcher ( expression ) ; StringBuffer sb = new StringBuffer ( ) ; if ( matcher . find ( ) ) { do { String predicateStr = matcher . group ( 0 ) ; String unusabl...
Replace certain XPath patterns that are not used or understood .
33,229
protected String replaceXPathPatterns ( String expression ) { assert expression != null ; expression = expression . replaceAll ( "[\\|]{2,}" , "|" ) ; expression = expression . replaceAll ( "/(\\([^|]+)(\\|){2,}([^)]+\\))" , "(/$1$2$3)?" ) ; expression = expression . replaceAll ( "/\\(\\|+([^)]+)\\)" , "(?:/($1))?" ) ;...
Replace certain XPath patterns including some predicates with substrings that are compatible with regular expressions .
33,230
public Object get ( String name ) { Object obj = document . get ( name ) ; return ( obj instanceof BasicArray ) ? ( ( BasicArray ) obj ) . toArray ( ) : obj ; }
Gets property value .
33,231
private void readFromStream ( InputStream in ) throws IOException { document = DocumentFactory . newDocument ( Json . read ( in ) ) ; }
Reads document content from the stream .
33,232
public final String [ ] getPathExpressions ( ) { String pathExpression = this . pathExpression ; Object [ ] pathExpressions = this . pathExpressions ; if ( pathExpression == null && ( pathExpressions == null || pathExpressions . length == 0 ) ) { return new String [ ] { } ; } if ( pathExpression != null && ( pathExpres...
Obtain the path expressions as configured on the sequencer . This method always returns a copy to prevent modification of the values .
33,233
public final boolean isAccepted ( String mimeType ) { if ( mimeType != null && hasAcceptedMimeTypes ( ) ) { return getAcceptedMimeTypes ( ) . contains ( mimeType . trim ( ) ) ; } return true ; }
Determine if this sequencer has been configured to accept and process content with the supplied MIME type .
33,234
private List < SessionNode > getChangedNodesAtOrBelowChildrenFirst ( Path nodePath ) { List < SessionNode > changedNodesChildrenFirst = new ArrayList < SessionNode > ( ) ; for ( NodeKey key : changedNodes . keySet ( ) ) { SessionNode changedNode = changedNodes . get ( key ) ; boolean isAtOrBelow = false ; try { isAtOrB...
Returns the list of changed nodes at or below the given path starting with the children .
33,235
private void completeTransaction ( final String txId , String wsName ) { getWorkspace ( ) . clear ( ) ; setWorkspaceCache ( sharedWorkspaceCache ( ) ) ; COMPLETE_FUNCTION_BY_TX_AND_WS . compute ( txId , ( transactionId , funcsByWsName ) -> { funcsByWsName . remove ( wsName ) ; if ( funcsByWsName . isEmpty ( ) ) { LOCKE...
Signal that the transaction that was active and in which this session participated has completed and that this session should no longer use a transaction - specific workspace cache .
33,236
private void rollback ( Transaction txn , Exception cause ) throws Exception { try { txn . rollback ( ) ; } catch ( Exception e ) { logger . debug ( e , "Error while rolling back transaction " + txn ) ; } finally { throw cause ; } }
Rolling back given transaction caused by given cause .
33,237
public static Date createDate ( Calendar target ) { return new java . sql . Date ( target . getTime ( ) . getTime ( ) ) ; }
Creates normalized SQL Date Object based on the target Calendar
33,238
public void mergeNodes ( DdlTokenStream tokens , AstNode firstNode , AstNode secondNode ) { assert tokens != null ; assert firstNode != null ; assert secondNode != null ; int firstStartIndex = ( Integer ) firstNode . getProperty ( DDL_START_CHAR_INDEX ) ; int secondStartIndex = ( Integer ) secondNode . getProperty ( DD...
Merges second node into first node by re - setting expression source and length .
33,239
protected AstNode parseCreateStatement ( DdlTokenStream tokens , AstNode parentNode ) throws ParsingException { assert tokens != null ; assert parentNode != null ; AstNode stmtNode = null ; if ( tokens . matches ( STMT_CREATE_SCHEMA ) ) { stmtNode = parseCreateSchemaStatement ( tokens , parentNode ) ; } else if ( token...
Parses DDL CREATE statement based on SQL 92 specifications .
33,240
protected AstNode parseAlterStatement ( DdlTokenStream tokens , AstNode parentNode ) throws ParsingException { assert tokens != null ; assert parentNode != null ; if ( tokens . matches ( ALTER , TABLE ) ) { return parseAlterTableStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( "ALTER" , "DOMAIN" ) ) {...
Parses DDL ALTER statement based on SQL 92 specifications .
33,241
protected String getTableElementsString ( DdlTokenStream tokens , boolean useTerminator ) throws ParsingException { assert tokens != null ; StringBuilder sb = new StringBuilder ( 100 ) ; if ( useTerminator ) { while ( ! isTerminator ( tokens ) ) { sb . append ( SPACE ) . append ( tokens . consume ( ) ) ; } } else { tok...
Method which extracts the table element string from a CREATE TABLE statement .
33,242
protected void parseConstraintAttributes ( DdlTokenStream tokens , AstNode constraintNode ) throws ParsingException { assert tokens != null ; assert constraintNode != null ; if ( tokens . canConsume ( "INITIALLY" , "DEFERRED" ) ) { AstNode attrNode = nodeFactory ( ) . node ( "CONSTRAINT_ATTRIBUTE" , constraintNode , TY...
Parses the attributes associated with any in - line column constraint definition or a table constrain definition .
33,243
protected List < String > getDataTypeStartWords ( ) { if ( allDataTypeStartWords == null ) { allDataTypeStartWords = new ArrayList < String > ( ) ; allDataTypeStartWords . addAll ( DataTypes . DATATYPE_START_WORDS ) ; allDataTypeStartWords . addAll ( getCustomDataTypeStartWords ( ) ) ; } return allDataTypeStartWords ; ...
Returns a list of data type start words which can be used to help identify a column definition sub - statement .
33,244
protected String consumeIdentifier ( DdlTokenStream tokens ) throws ParsingException { String value = tokens . consume ( ) ; if ( value . charAt ( 0 ) == '"' ) { int length = value . length ( ) ; value = value . substring ( 1 , length - 1 ) ; } return value ; }
Consumes an token identifier which can be of the form of a simple string or a double - quoted string .
33,245
protected boolean parseColumnNameList ( DdlTokenStream tokens , AstNode parentNode , String referenceType ) { boolean parsedColumns = false ; List < String > columnNameList = new ArrayList < String > ( ) ; if ( tokens . matches ( L_PAREN ) ) { tokens . consume ( L_PAREN ) ; columnNameList = parseNameList ( tokens ) ; i...
Adds column reference nodes to a parent node . Returns true if column references added false if not .
33,246
protected List < String > parseNameList ( DdlTokenStream tokens ) throws ParsingException { List < String > names = new LinkedList < String > ( ) ; while ( true ) { names . add ( parseName ( tokens ) ) ; if ( ! tokens . canConsume ( COMMA ) ) { break ; } } return names ; }
Parses a comma separated list of names .
33,247
protected String parseUntilTerminator ( DdlTokenStream tokens ) throws ParsingException { final StringBuilder sb = new StringBuilder ( ) ; boolean lastTokenWasPeriod = false ; Position prevPosition = ( tokens . hasNext ( ) ? tokens . nextPosition ( ) : Position . EMPTY_CONTENT_POSITION ) ; String prevToken = "" ; while...
Utility method which parses tokens until a terminator is found another statement is identified or there are no more tokens .
33,248
protected String parseUntilSemiColon ( DdlTokenStream tokens ) throws ParsingException { StringBuilder sb = new StringBuilder ( ) ; boolean lastTokenWasPeriod = false ; while ( tokens . hasNext ( ) && ! tokens . matches ( SEMICOLON ) ) { String thisToken = tokens . consume ( ) ; boolean thisTokenIsPeriod = thisToken . ...
Utility method which parses tokens until a semicolon is found or there are no more tokens .
33,249
final boolean registerListener ( NodeTypes . Listener listener ) { return listener != null ? this . listeners . addIfAbsent ( listener ) : false ; }
Add a listener that will be notified when the NodeTypes changes . Listeners will be called in a single thread and should do almost no work .
33,250
boolean isNodeTypeInUse ( Name nodeTypeName ) throws InvalidQueryException { String nodeTypeString = nodeTypeName . getString ( context . getNamespaceRegistry ( ) ) ; String expression = "SELECT * from [" + nodeTypeString + "] LIMIT 1" ; TypeSystem typeSystem = context . getValueFactories ( ) . getTypeSystem ( ) ; Quer...
Check if the named node type is in use in any workspace in the repository
33,251
protected void doInitialize ( IndexProvider provider ) throws RepositoryException { Reflection . setValue ( provider , "context" , repository . context ( ) ) ; Reflection . setValue ( provider , "environment" , repository . environment ( ) ) ; provider . initialize ( ) ; Method postInitialize = Reflection . findMethod ...
Initialize the supplied provider .
33,252
IndexWriter getIndexWriterForProviders ( Set < String > providerNames ) { List < IndexProvider > reindexProviders = new LinkedList < > ( ) ; for ( IndexProvider provider : providers . values ( ) ) { if ( providerNames . contains ( provider . getName ( ) ) ) { reindexProviders . add ( provider ) ; } } return CompositeIn...
Get the query index writer that will delegate to only those registered providers with the given names .
33,253
public void start ( ) { ObjectName beanName = null ; try { MBeanServer server = ManagementFactory . getPlatformMBeanServer ( ) ; beanName = getObjectName ( ) ; server . registerMBean ( this , beanName ) ; } catch ( InstanceAlreadyExistsException e ) { LOGGER . warn ( JcrI18n . mBeanAlreadyRegistered , beanName ) ; } ca...
Initializes & registers this MBean with the local MBean server .
33,254
public void stop ( ) { MBeanServer server = ManagementFactory . getPlatformMBeanServer ( ) ; ObjectName beanName = null ; try { beanName = getObjectName ( ) ; server . unregisterMBean ( beanName ) ; } catch ( InstanceNotFoundException e ) { LOGGER . debug ( "JMX bean {0} not found" , beanName ) ; } catch ( Exception e ...
Un - registers the bean from the JMX server .
33,255
public void show ( String repository , final boolean changeHistory ) { this . repository = repository ; refreshWorkspacesAndReloadNode ( null , ROOT_PATH , changeHistory ) ; }
Shows content of the root node of the first reachable workspace of the given repository .
33,256
public void show ( final String repository , final String workspace , final String path , final boolean changeHistory ) { this . repository = repository ; this . refreshWorkspacesAndReloadNode ( null , path , changeHistory ) ; }
Shows nodes identified by repository workspace and path to node .
33,257
private void refreshWorkspacesAndReloadNode ( final String name , final String path , final boolean changeHistory ) { showLoadIcon ( ) ; console . jcrService ( ) . getWorkspaces ( repository , new AsyncCallback < String [ ] > ( ) { public void onFailure ( Throwable caught ) { hideLoadIcon ( ) ; RemoteException e = ( Re...
Reloads values of the combo box with workspace names .
33,258
public void getAndDisplayNode ( final String path , final boolean changeHistory ) { showLoadIcon ( ) ; console . jcrService ( ) . node ( repository ( ) , workspace ( ) , path , new AsyncCallback < JcrNode > ( ) { public void onFailure ( Throwable caught ) { hideLoadIcon ( ) ; SC . say ( caught . getMessage ( ) ) ; } pu...
Reads node with given path and selected repository and workspace .
33,259
private void displayNode ( JcrNode node ) { this . node = node ; this . path = node . getPath ( ) ; pathLabel . display ( node . getPath ( ) ) ; childrenEditor . show ( node ) ; propertiesEditor . show ( node ) ; permissionsEditor . show ( node ) ; displayBinaryContent ( node ) ; }
Displays specified node .
33,260
public void save ( ) { SC . ask ( "Do you want to save changes" , new BooleanCallback ( ) { public void execute ( Boolean yesSelected ) { if ( yesSelected ) { jcrService ( ) . save ( repository ( ) , workspace ( ) , new BaseCallback < Object > ( ) { public void onSuccess ( Object result ) { session ( ) . setHasChanges ...
Save session s changes .
33,261
public void showAddNodeDialog ( ) { jcrService ( ) . getPrimaryTypes ( node . getRepository ( ) , node . getWorkspace ( ) , null , false , new AsyncCallback < String [ ] > ( ) { public void onFailure ( Throwable caught ) { SC . say ( caught . getMessage ( ) ) ; } public void onSuccess ( String [ ] result ) { addNodeDia...
Prepares dialog for creating new node .
33,262
public void exportXML ( String name , boolean skipBinary , boolean noRecurse ) { console . jcrService ( ) . export ( repository , workspace ( ) , path ( ) , name , true , true , new AsyncCallback < Object > ( ) { public void onFailure ( Throwable caught ) { SC . say ( caught . getMessage ( ) ) ; } public void onSuccess...
Exports contents to the given file .
33,263
public void importXML ( String name , int option ) { console . jcrService ( ) . importXML ( repository , workspace ( ) , path ( ) , name , option , new AsyncCallback < Object > ( ) { public void onFailure ( Throwable caught ) { SC . say ( caught . getMessage ( ) ) ; } public void onSuccess ( Object result ) { SC . say ...
Imports contents from the given file .
33,264
protected String branchRefForName ( String branchName ) { String remoteName = connector . remoteName ( ) ; return remoteName != null ? remoteBranchPrefix ( remoteName ) + branchName : LOCAL_BRANCH_PREFIX + branchName ; }
Obtain the name of the branch reference
33,265
protected void addBranchesAsChildren ( Git git , CallSpecification spec , DocumentWriter writer ) throws GitAPIException { Set < String > remoteBranchPrefixes = remoteBranchPrefixes ( ) ; if ( remoteBranchPrefixes . isEmpty ( ) ) { ListBranchCommand command = git . branchList ( ) ; List < Ref > branches = command . cal...
Add the names of the branches as children of the current node .
33,266
protected void addTagsAsChildren ( Git git , CallSpecification spec , DocumentWriter writer ) throws GitAPIException { ListTagCommand command = git . tagList ( ) ; List < Ref > tags = command . call ( ) ; Collections . sort ( tags , REVERSE_REF_COMPARATOR ) ; for ( Ref ref : tags ) { String fullName = ref . getName ( )...
Add the names of the tags as children of the current node .
33,267
protected void addCommitsAsChildren ( Git git , CallSpecification spec , DocumentWriter writer , int pageSize ) throws GitAPIException { LogCommand command = git . log ( ) ; command . setSkip ( 0 ) ; command . setMaxCount ( pageSize ) ; int actual = 0 ; String commitId = null ; for ( RevCommit commit : command . call (...
Add the first page of commits in the history names of the tags as children of the current node .
33,268
protected void addCommitsAsPageOfChildren ( Git git , Repository repository , CallSpecification spec , PageWriter writer , PageKey pageKey ) throws GitAPIException , IOException { RevWalk walker = new RevWalk ( repository ) ; try { String lastCommitIdName = pageKey . getOffsetString ( ) ; ObjectId lastCommitId = reposi...
Add an additional page of commits in the history names of the tags as children of the current node .
33,269
boolean isAsOrMoreConstrainedThan ( PropertyDefinition other , ExecutionContext context ) { String [ ] otherConstraints = other . getValueConstraints ( ) ; if ( otherConstraints == null || otherConstraints . length == 0 ) { return true ; } String [ ] constraints = this . getValueConstraints ( ) ; if ( constraints == nu...
Determine if the constraints on this definition are as - constrained or more - constrained than those on the supplied definition .
33,270
protected void initializeStorage ( File directory ) throws BinaryStoreException { FileUtil . delete ( directory ) ; if ( ! directory . exists ( ) ) { logger . debug ( "Creating temporary directory for transient binary store: {0}" , directory . getAbsolutePath ( ) ) ; directory . mkdirs ( ) ; } if ( ! directory . canRea...
Ensures that the directory used by this binary store exists and can be both read and written to .
33,271
public Workspace addWorkspace ( String name , String repositoryUrl ) { Workspace workspace = new Workspace ( name , repositoryUrl ) ; workspaces . add ( workspace ) ; return workspace ; }
Adds a new workspace to the list of workspaces .
33,272
protected void modifyProperties ( NodeKey key , Name primaryType , Set < Name > mixinTypes , Map < Name , AbstractPropertyChange > propChanges ) { }
Handle the addition change and removal of one or more properties of a single node . This method is called once for each existing node whose properties are modified .
33,273
protected void addNode ( String workspaceName , NodeKey key , Path path , Name primaryType , Set < Name > mixinTypes , Properties properties ) { }
Handle the addition of a node .
33,274
protected void removeNode ( String workspaceName , NodeKey key , NodeKey parentKey , Path path , Name primaryType , Set < Name > mixinTypes ) { }
Handle the removal of a node .
33,275
protected void changeNode ( String workspaceName , NodeKey key , Path path , Name primaryType , Set < Name > mixinTypes ) { }
Handle the change of a node .
33,276
protected void moveNode ( String workspaceName , NodeKey key , Name primaryType , Set < Name > mixinTypes , NodeKey oldParent , NodeKey newParent , Path newPath , Path oldPath ) { }
Handle the move of a node .
33,277
protected void renameNode ( String workspaceName , NodeKey key , Path newPath , Segment oldSegment , Name primaryType , Set < Name > mixinTypes ) { }
Handle the renaming of a node .
33,278
protected void reorderNode ( String workspaceName , NodeKey key , Name primaryType , Set < Name > mixinTypes , NodeKey parent , Path newPath , Path oldPath , Path reorderedBeforePath , Map < NodeKey , Map < Path , Path > > snsPathChangesByNodeKey ) { }
Handle the reordering of a node .
33,279
public static < T1 , T2 > TypeFactory < Tuple2 < T1 , T2 > > typeFactory ( TypeFactory < T1 > type1 , TypeFactory < T2 > type2 ) { return new Tuple2TypeFactory < > ( type1 , type2 ) ; }
Create a type factory for tuples of size 2 .
33,280
public static < T1 , T2 , T3 > TypeFactory < Tuple3 < T1 , T2 , T3 > > typeFactory ( TypeFactory < T1 > type1 , TypeFactory < T2 > type2 , TypeFactory < T3 > type3 ) { return new Tuple3TypeFactory < > ( type1 , type2 , type3 ) ; }
Create a type factory for tuples of size 3 .
33,281
public static < T1 , T2 , T3 , T4 > TypeFactory < Tuple4 < T1 , T2 , T3 , T4 > > typeFactory ( TypeFactory < T1 > type1 , TypeFactory < T2 > type2 , TypeFactory < T3 > type3 , TypeFactory < T4 > type4 ) { return new Tuple4TypeFactory < > ( type1 , type2 , type3 , type4 ) ; }
Create a type factory for tuples of size 4 .
33,282
public static TypeFactory < ? > typeFactory ( TypeFactory < ? > type , int tupleSize ) { if ( tupleSize <= 1 ) return type ; if ( tupleSize == 2 ) return typeFactory ( type , type ) ; if ( tupleSize == 3 ) return typeFactory ( type , type , type ) ; if ( tupleSize == 4 ) return typeFactory ( type , type , type , type )...
Create a type factory for uniform tuples .
33,283
private Privilege [ ] privileges ( Set < String > names ) throws ValueFormatException , AccessControlException , RepositoryException { Privilege [ ] privileges = new Privilege [ names . size ( ) ] ; int i = 0 ; for ( String name : names ) { privileges [ i ++ ] = privilegeFromName ( name ) ; } return privileges ; }
Constructs list of Privilege objects using privilege s name .
33,284
protected static String determineMethodsAllowed ( StoredObject so ) { try { if ( so != null ) { if ( so . isNullResource ( ) ) { return NULL_RESOURCE_METHODS_ALLOWED ; } else if ( so . isFolder ( ) ) { return RESOURCE_METHODS_ALLOWED + FOLDER_METHOD_ALLOWED ; } return RESOURCE_METHODS_ALLOWED ; } } catch ( Exception e ...
Determines the methods normally allowed for the resource .
33,285
protected AstNode parseCreateIndex ( DdlTokenStream tokens , AstNode parentNode ) throws ParsingException { assert tokens != null ; assert parentNode != null ; markStartOfStatement ( tokens ) ; tokens . consume ( CREATE ) ; boolean isUnique = tokens . canConsume ( "UNIQUE" ) ; tokens . consume ( "INDEX" ) ; String inde...
Parses DDL CREATE INDEX
33,286
protected AstNode parseCreateRole ( DdlTokenStream tokens , AstNode parentNode ) throws ParsingException { assert tokens != null ; assert parentNode != null ; markStartOfStatement ( tokens ) ; tokens . consume ( CREATE , "ROLE" ) ; String functionName = parseName ( tokens ) ; AstNode functionNode = nodeFactory ( ) . no...
Parses DDL CREATE ROLE statement
33,287
protected void parseColumns ( DdlTokenStream tokens , AstNode tableNode , boolean isAlterTable ) throws ParsingException { String tableElementString = getTableElementsString ( tokens , false ) ; DdlTokenStream localTokens = new DdlTokenStream ( tableElementString , DdlTokenStream . ddlTokenizer ( false ) , false ) ; lo...
Utility method designed to parse columns within an ALTER TABLE ADD statement .
33,288
public static Set < Column > getColumnsReferencedBy ( Visitable visitable ) { if ( visitable == null ) return Collections . emptySet ( ) ; final Set < Column > symbols = new HashSet < Column > ( ) ; Visitors . visitAll ( visitable , new AbstractVisitor ( ) { protected void addColumnFor ( SelectorName selectorName , Str...
Get the set of Column objects that represent those columns referenced by the visitable object .
33,289
protected static void removeTralingZeros ( StringBuilder sb ) { int endIndex = sb . length ( ) ; if ( endIndex > 0 ) { -- endIndex ; int index = endIndex ; while ( sb . charAt ( index ) == '0' ) { -- index ; } if ( index < endIndex ) sb . delete ( index + 1 , endIndex + 1 ) ; } }
Utility to remove the trailing 0 s .
33,290
public static void write ( String content , File file ) throws IOException { CheckArg . isNotNull ( file , "destination file" ) ; if ( content != null ) { write ( content , new FileOutputStream ( file ) ) ; } }
Write the entire contents of the supplied string to the given file .
33,291
public static void closeQuietly ( Closeable closeable ) { if ( closeable == null ) { return ; } try { closeable . close ( ) ; } catch ( Throwable t ) { LOGGER . debug ( t , "Ignored error at closing stream" ) ; } }
Closes the closable silently . Any exceptions are ignored .
33,292
public void setNullResource ( boolean f ) { this . isNullRessource = f ; this . isFolder = false ; this . creationDate = null ; this . lastModified = null ; this . contentLength = 0 ; this . mimeType = null ; }
Sets a StoredObject as a lock - null resource
33,293
protected void endContent ( ) throws RepositoryException { String content = StringUtil . normalize ( contentBuilder . toString ( ) ) ; contentBuilder = null ; if ( content . length ( ) > 0 ) { startNode ( XmlLexicon . ELEMENT_CONTENT , XmlLexicon . ELEMENT_CONTENT ) ; currentNode . setProperty ( XmlLexicon . ELEMENT_CO...
See if there is any element content that needs to be completed .
33,294
public void show ( int x , int y ) { disabledHLayout . setSize ( "100%" , "100%" ) ; disabledHLayout . setStyleName ( "disabledBackgroundStyle" ) ; disabledHLayout . show ( ) ; loadingImg . setSize ( "100px" , "100px" ) ; loadingImg . setTop ( y ) ; loadingImg . setLeft ( x ) ; loadingImg . show ( ) ; loadingImg . brin...
Shows loading indicator at the given place of screen .
33,295
void checkout ( AbstractJcrNode node ) throws LockException , RepositoryException { checkVersionable ( node ) ; if ( node . isLocked ( ) && ! node . holdsLock ( ) ) { throw new LockException ( JcrI18n . lockTokenNotHeld . text ( node . getPath ( ) ) ) ; } if ( ! node . hasProperty ( JcrLexicon . BASE_VERSION ) ) { retu...
Checks out the given node updating version - related properties on the node as needed .
33,296
public ExecutionContext with ( Map < String , String > data ) { Map < String , String > newData = data ; if ( newData == null ) { if ( this . data . isEmpty ( ) ) return this ; } else { newData = Collections . unmodifiableMap ( new HashMap < String , String > ( data ) ) ; } return new ExecutionContext ( securityContext...
Create a new execution context that mirrors this context but that contains the supplied data . Note that the supplied map is always copied to ensure that it is immutable .
33,297
public ExecutionContext with ( String key , String value ) { Map < String , String > newData = data ; if ( value == null ) { if ( this . data . isEmpty ( ) || ! this . data . containsKey ( key ) ) { return this ; } newData = new HashMap < String , String > ( data ) ; newData . remove ( key ) ; newData = Collections . u...
Create a new execution context that mirrors this context but that contains the supplied key - value pair in the new context s data .
33,298
public ExecutionContext with ( Locale locale ) { return new ExecutionContext ( securityContext , namespaceRegistry , propertyFactory , threadPools , binaryStore , data , processId , decoder , encoder , stringFactory , binaryFactory , booleanFactory , dateFactory , decimalFactory , doubleFactory , longFactory , nameFact...
Create a new execution context that mirrors this context but that contains the supplied locale .
33,299
protected void initializeDefaultNamespaces ( NamespaceRegistry namespaceRegistry ) { if ( namespaceRegistry == null ) return ; namespaceRegistry . register ( JcrLexicon . Namespace . PREFIX , JcrLexicon . Namespace . URI ) ; namespaceRegistry . register ( JcrMixLexicon . Namespace . PREFIX , JcrMixLexicon . Namespace ....
Method that initializes the default namespaces for namespace registries .