idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
152,000
public B camundaInputParameter ( String name , String value ) { CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement ( CamundaInputOutput . class ) ; CamundaInputParameter camundaInputParameter = createChild ( camundaInputOutput , CamundaInputParameter . class ) ; camundaInputParameter . setCamundaName ( name ) ; camundaInputParameter . setTextContent ( value ) ; return myself ; }
Creates a new camunda input parameter extension element with the given name and value .
92
17
152,001
public B camundaOutputParameter ( String name , String value ) { CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement ( CamundaInputOutput . class ) ; CamundaOutputParameter camundaOutputParameter = createChild ( camundaInputOutput , CamundaOutputParameter . class ) ; camundaOutputParameter . setCamundaName ( name ) ; camundaOutputParameter . setTextContent ( value ) ; return myself ; }
Creates a new camunda output parameter extension element with the given name and value .
92
17
152,002
public MessageEventDefinitionBuilder messageEventDefinition ( String id ) { MessageEventDefinition messageEventDefinition = createEmptyMessageEventDefinition ( ) ; if ( id != null ) { messageEventDefinition . setId ( id ) ; } element . getEventDefinitions ( ) . add ( messageEventDefinition ) ; return new MessageEventDefinitionBuilder ( modelInstance , messageEventDefinition ) ; }
Creates an empty message event definition with the given id and returns a builder for the message event definition .
78
21
152,003
public SignalEventDefinitionBuilder signalEventDefinition ( String signalName ) { SignalEventDefinition signalEventDefinition = createSignalEventDefinition ( signalName ) ; element . getEventDefinitions ( ) . add ( signalEventDefinition ) ; return new SignalEventDefinitionBuilder ( modelInstance , signalEventDefinition ) ; }
Sets an event definition for the given Signal name . If a signal with this name already exists it will be used otherwise a new signal is created . It returns a builder for the Signal Event Definition .
63
40
152,004
public B from ( FlowNode source ) { element . setSource ( source ) ; source . getOutgoing ( ) . add ( element ) ; return myself ; }
Sets the source flow node of this sequence flow .
34
11
152,005
public B to ( FlowNode target ) { element . setTarget ( target ) ; target . getIncoming ( ) . add ( element ) ; return myself ; }
Sets the target flow node of this sequence flow .
34
11
152,006
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public < T extends AbstractFlowNodeBuilder > T messageEventDefinitionDone ( ) { return ( T ) ( ( Event ) element . getParentElement ( ) ) . builder ( ) ; }
Finishes the building of a message event definition .
58
10
152,007
public B compensation ( ) { CompensateEventDefinition compensateEventDefinition = createCompensateEventDefinition ( ) ; element . getEventDefinitions ( ) . add ( compensateEventDefinition ) ; return myself ; }
Sets a catch compensation definition .
44
7
152,008
public static void setSessionTicketKeys ( long ctx , SessionTicketKey [ ] keys ) { if ( keys == null || keys . length == 0 ) { throw new IllegalArgumentException ( "Length of the keys should be longer than 0." ) ; } byte [ ] binaryKeys = new byte [ keys . length * SessionTicketKey . TICKET_KEY_SIZE ] ; for ( int i = 0 ; i < keys . length ; i ++ ) { SessionTicketKey key = keys [ i ] ; int dstCurPos = SessionTicketKey . TICKET_KEY_SIZE * i ; System . arraycopy ( key . name , 0 , binaryKeys , dstCurPos , SessionTicketKey . NAME_SIZE ) ; dstCurPos += SessionTicketKey . NAME_SIZE ; System . arraycopy ( key . hmacKey , 0 , binaryKeys , dstCurPos , SessionTicketKey . HMAC_KEY_SIZE ) ; dstCurPos += SessionTicketKey . HMAC_KEY_SIZE ; System . arraycopy ( key . aesKey , 0 , binaryKeys , dstCurPos , SessionTicketKey . AES_KEY_SIZE ) ; } setSessionTicketKeys0 ( ctx , binaryKeys ) ; }
Set TLS session ticket keys .
269
6
152,009
private static String calculatePackagePrefix ( ) { String maybeShaded = Library . class . getName ( ) ; // Use ! instead of . to avoid shading utilities from modifying the string String expected = "io!netty!internal!tcnative!Library" . replace ( ' ' , ' ' ) ; if ( ! maybeShaded . endsWith ( expected ) ) { throw new UnsatisfiedLinkError ( String . format ( "Could not find prefix added to %s to get %s. When shading, only adding a " + "package prefix is supported" , expected , maybeShaded ) ) ; } return maybeShaded . substring ( 0 , maybeShaded . length ( ) - expected . length ( ) ) ; }
The shading prefix added to this class s full name .
155
11
152,010
public static boolean initialize ( String libraryName , String engine ) throws Exception { if ( _instance == null ) { _instance = libraryName == null ? new Library ( ) : new Library ( libraryName ) ; if ( aprMajorVersion ( ) < 1 ) { throw new UnsatisfiedLinkError ( "Unsupported APR Version (" + aprVersionString ( ) + ")" ) ; } if ( ! aprHasThreads ( ) ) { throw new UnsatisfiedLinkError ( "Missing APR_HAS_THREADS" ) ; } } return initialize0 ( ) && SSL . initialize ( engine ) == 0 ; }
Setup native library . This is the first method that must be called!
132
14
152,011
public static < S , R > List < R > convert ( List < S > source , Function < S , R > converter ) { return ( source == null ) ? null : source . stream ( ) . filter ( Objects :: nonNull ) . map ( converter ) . filter ( Objects :: nonNull ) . collect ( Collectors . toList ( ) ) ; }
Convert a list of a given type using converter .
76
11
152,012
public static ProcessHandler getDefaultHandler ( Logger logger ) { return LegacyProcessHandler . builder ( ) . addStdErrLineListener ( logger :: lifecycle ) . addStdOutLineListener ( logger :: lifecycle ) . setExitListener ( new NonZeroExceptionExitListener ( ) ) . build ( ) ; }
Create a return a new default configured process handler .
68
10
152,013
public void setExplodedAppDirectory ( File explodedAppDirectory ) { this . explodedAppDirectory = explodedAppDirectory ; into ( explodedAppDirectory ) ; preserve ( patternFilterable -> patternFilterable . include ( "WEB-INF/appengine-generated/datastore-indexes-auto.xml" ) ) ; }
Sets the output directory of Sync Task and preserves the setting so it can be recovered later via getter .
70
22
152,014
@ Optional @ InputFiles public FileCollection getExtraFilesDirectoriesAsInputFiles ( ) { if ( extraFilesDirectories == null ) { return null ; } FileCollection files = project . files ( ) ; for ( File directory : extraFilesDirectories ) { files = files . plus ( project . fileTree ( directory ) ) ; } return files ; }
This method is purely for incremental build calculations .
74
9
152,015
public void configureCoreProperties ( Project project , AppEngineCoreExtensionProperties appEngineCoreExtensionProperties , String taskGroup , boolean requiresAppEngineJava ) { project . getLogger ( ) . warn ( "WARNING: You are a using release candidate " + getClass ( ) . getPackage ( ) . getImplementationVersion ( ) + ". Behavior of this plugin has changed since 1.3.5. Please see release notes at: " + "https://github.com/GoogleCloudPlatform/app-gradle-plugin." ) ; project . getLogger ( ) . warn ( "Missing a feature? Can't get it to work?, please file a bug at: " + "https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues." ) ; checkGradleVersion ( ) ; this . project = project ; this . taskGroup = taskGroup ; this . toolsExtension = appEngineCoreExtensionProperties . getTools ( ) ; this . deployExtension = appEngineCoreExtensionProperties . getDeploy ( ) ; this . requiresAppEngineJava = requiresAppEngineJava ; configureFactories ( ) ; createDownloadCloudSdkTask ( ) ; createCheckCloudSdkTask ( ) ; createLoginTask ( ) ; createDeployTask ( ) ; createDeployCronTask ( ) ; createDeployDispatchTask ( ) ; createDeployDosTask ( ) ; createDeployIndexTask ( ) ; createDeployQueueTask ( ) ; createDeployAllTask ( ) ; createShowConfigurationTask ( ) ; }
Configure core tasks for appengine app . yaml and appengine - web . xml based project plugins .
327
22
152,016
public boolean isVm ( ) { try { XPath xpath = XPathFactory . newInstance ( ) . newXPath ( ) ; String expression = "/appengine-web-app/vm/text()='true'" ; return ( Boolean ) xpath . evaluate ( expression , document , XPathConstants . BOOLEAN ) ; } catch ( XPathExpressionException e ) { throw new GradleException ( "XPath evaluation failed on appengine-web.xml" , e ) ; } }
Check if vm = true .
109
6
152,017
public ManagedCloudSdk newManagedSdk ( ) throws UnsupportedOsException , BadCloudSdkVersionException { if ( Strings . isNullOrEmpty ( version ) ) { return ManagedCloudSdk . newManagedSdk ( ) ; } else { return ManagedCloudSdk . newManagedSdk ( new Version ( version ) ) ; } }
Build a new ManagedCloudSdk from a given version .
80
13
152,018
@ SuppressWarnings ( "unchecked" ) public < T > T get ( String ... path ) { ExtensionAware root = searchRoot ; for ( String name : path ) { ExtensionContainer children = root . getExtensions ( ) ; root = ( ExtensionAware ) children . getByName ( name ) ; } return ( T ) root ; // this is potentially unchecked. }
Get an extension by it s path potentially will throw all kinds of exceptions . Be very careful .
82
19
152,019
private void configureArchiveTask ( AbstractArchiveTask archiveTask ) { if ( archiveTask == null ) { return ; } archiveTask . dependsOn ( "_createSourceContext" ) ; archiveTask . from ( extension . getOutputDirectory ( ) , copySpec -> copySpec . into ( "WEB-INF/classes" ) ) ; }
inject source - context into the META - INF directory of a jar or war
73
17
152,020
private void writeMetrics ( ) throws IOException { if ( metrics . size ( ) > 0 ) { try { byte [ ] payload = pickleMetrics ( metrics ) ; byte [ ] header = ByteBuffer . allocate ( 4 ) . putInt ( payload . length ) . array ( ) ; OutputStream outputStream = socket . getOutputStream ( ) ; outputStream . write ( header ) ; outputStream . write ( payload ) ; outputStream . flush ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Wrote {} metrics" , metrics . size ( ) ) ; } } catch ( IOException e ) { this . failures ++ ; throw e ; } finally { // if there was an error, we might miss some data. for now, drop those on the floor and // try to keep going. metrics . clear ( ) ; } } }
1 . Run the pickler script to package all the pending metrics into a single message 2 . Send the message to graphite 3 . Clear out the list of metrics
186
33
152,021
@ Override public SystemState restore ( long fromVersion , TxRepository repository ) { workflowContext . repository ( repository ) ; final long snapshotTransactionId = repository . getO ( SystemInfo . class , 0L ) . orElse ( new SystemInfo ( 0L ) ) . lastTransactionId ; final long [ ] transactionId = { snapshotTransactionId } ; try ( InputProcessor processor = new DefaultInputProcessor ( journalStorage ) ) { processor . process ( fromVersion , b -> { EventsCommitInfo e = eventsContext . serializer ( ) . deserialize ( eventsContext . eventsCommitBuilder ( ) , b ) ; eventBus . processNextEvent ( e ) ; } , JournalType . EVENTS ) ; processor . process ( fromVersion , b -> { TransactionCommitInfo tx = workflowContext . serializer ( ) . deserialize ( workflowContext . transactionCommitBuilder ( ) , b ) ; if ( tx . transactionId ( ) > transactionId [ 0 ] || tx . transactionId ( ) == snapshotTransactionId ) { transactionId [ 0 ] = tx . transactionId ( ) ; workflowEngine . getPipe ( ) . executeRestore ( eventBus , tx ) ; } else if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Transaction ID {} less than last Transaction ID {}" , tx . transactionId ( ) , transactionId [ 0 ] ) ; } } , JournalType . TRANSACTIONS ) ; } catch ( Throwable t ) { LOG . error ( "restore" , t ) ; throw new RuntimeException ( t ) ; } workflowEngine . getPipe ( ) . sync ( ) ; workflowContext . eventPublisher ( ) . getPipe ( ) . sync ( ) ; return new SystemState ( transactionId [ 0 ] ) ; }
Reads all journals and restores all previous system mode state from them into the given repository . Also re - publish all events that were not sent by the reason of failure abortion etc .
380
36
152,022
public static void printStackTrace ( SQLException e , PrintWriter pw ) { SQLException next = e ; while ( next != null ) { next . printStackTrace ( pw ) ; next = next . getNextException ( ) ; if ( next != null ) { pw . println ( "Next SQLException:" ) ; } } }
Print the stack trace for a SQLException to a specified PrintWriter .
80
16
152,023
public static void printWarnings ( Connection conn , PrintWriter pw ) { if ( conn != null ) { try { printStackTrace ( conn . getWarnings ( ) , pw ) ; } catch ( SQLException e ) { printStackTrace ( e , pw ) ; } } }
Print warnings on a Connection to a specified PrintWriter .
68
11
152,024
public XComponentContext connect ( String host , int port ) throws BootstrapException { String unoConnectString = "uno:socket,host=" + host + ",port=" + port + ";urp;StarOffice.ComponentContext" ; return connect ( unoConnectString ) ; }
Connects to an OOo server using the specified host and port for the socket and returns a component context for using the connection to the OOo server .
61
33
152,025
public void addDependency ( Area main , Area dependent ) { List < Area > set = areasDependency . get ( main ) ; if ( set == null ) { set = new ArrayList < Area > ( ) ; areasDependency . put ( main , set ) ; } set . add ( dependent ) ; }
Adds area dependency for formula calculations
69
6
152,026
public synchronized void kill ( ) { if ( oooProcess != null ) { log . info ( "OOServer is killing office instance with port {}" , port ) ; List < Long > pids = processManager . findPid ( host , port ) ; processManager . kill ( oooProcess , pids ) ; oooProcess = null ; } }
Kills the OOo server process from the previous start . If there has been no previous start of the OOo server the kill does nothing . If there has been a previous start kill destroys the process .
76
43
152,027
public XComponentContext connect ( String oooConnectionString ) throws BootstrapException { this . oooConnectionString = oooConnectionString ; XComponentContext xContext = null ; try { // get local context XComponentContext xLocalContext = getLocalContext ( ) ; oooServer . start ( ) ; // initial service manager XMultiComponentFactory xLocalServiceManager = xLocalContext . getServiceManager ( ) ; if ( xLocalServiceManager == null ) throw new BootstrapException ( "no initial service manager!" ) ; // create a URL resolver XUnoUrlResolver xUrlResolver = UnoUrlResolver . create ( xLocalContext ) ; // wait until office is started for ( int i = 0 ; ; ++ i ) { try { xContext = getRemoteContext ( xUrlResolver ) ; break ; } catch ( NoConnectException ex ) { // Wait 500 ms, then try to connect again, but do not wait // longer than 5 sec total: if ( i == 10 ) { throw new BootstrapException ( ex ) ; } Thread . sleep ( 500 ) ; } } } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new BootstrapException ( e ) ; } return xContext ; }
Connects to an OOo server using the specified accept option and connection string and returns a component context for using the connection to the OOo server .
265
32
152,028
public void disconnect ( ) { if ( oooConnectionString == null ) return ; // call office to terminate itself try { // get local context XComponentContext xLocalContext = getLocalContext ( ) ; // create a URL resolver XUnoUrlResolver xUrlResolver = UnoUrlResolver . create ( xLocalContext ) ; // get remote context XComponentContext xRemoteContext = getRemoteContext ( xUrlResolver ) ; // get desktop to terminate office Object desktop = xRemoteContext . getServiceManager ( ) . createInstanceWithContext ( "com.sun.star.frame.Desktop" , xRemoteContext ) ; XDesktop xDesktop = ( XDesktop ) UnoRuntime . queryInterface ( XDesktop . class , desktop ) ; xDesktop . terminate ( ) ; } catch ( Exception e ) { // Bad luck, unable to terminate office } oooServer . kill ( ) ; oooConnectionString = null ; }
Disconnects from an OOo server using the connection string from the previous connect .
197
18
152,029
protected XComponentContext getLocalContext ( ) throws BootstrapException , Exception { XComponentContext xLocalContext = Bootstrap . createInitialComponentContext ( null ) ; if ( xLocalContext == null ) { throw new BootstrapException ( "no local component context!" ) ; } return xLocalContext ; }
Create default local component context .
64
6
152,030
protected XComponentContext getRemoteContext ( XUnoUrlResolver xUrlResolver ) throws BootstrapException , ConnectionSetupException , IllegalArgumentException , NoConnectException { Object context = xUrlResolver . resolve ( oooConnectionString ) ; XComponentContext xContext = ( XComponentContext ) UnoRuntime . queryInterface ( XComponentContext . class , context ) ; if ( xContext == null ) { throw new BootstrapException ( "no component context!" ) ; } return xContext ; }
Try to connect to office .
107
6
152,031
@ Override public boolean next ( ) throws JRException { List < BandData > children = currentBand . getChildrenList ( ) ; if ( children != null && ! children . isEmpty ( ) && ! visitedBands . containsKey ( currentBand ) ) { currentIterator = children . iterator ( ) ; visitedBands . put ( currentBand , currentIterator ) ; } else if ( currentIterator == null ) { currentIterator = Collections . singletonList ( currentBand ) . iterator ( ) ; } if ( currentIterator . hasNext ( ) ) { currentBand = currentIterator . next ( ) ; if ( readBands . contains ( currentBand ) || currentBand . getData ( ) . isEmpty ( ) ) return next ( ) ; return true ; } else { BandData parentBand = currentBand . getParentBand ( ) ; currentBand = parentBand ; currentIterator = visitedBands . get ( parentBand ) ; if ( parentBand == null || parentBand . equals ( root ) ) return false ; return next ( ) ; } }
Maintains visitedBands to continue bypass on the same level after return from deeper level of hierarchy . Creates iterator for each level .
222
28
152,032
public JRBandDataDataSource subDataSource ( String bandName ) { if ( containsVisitedBand ( bandName ) ) return null ; BandData newParentBand = createNewBand ( bandName ) ; currentBand = root ; currentIterator = root . getChildrenList ( ) . iterator ( ) ; visitedBands . put ( root , currentIterator ) ; return new JRBandDataDataSource ( newParentBand ) ; }
Search for first level children band with specified name and return new datasource with this band as root element .
91
21
152,033
public < T > T query ( Connection conn , String sql , Object param , ResultSetHandler < T > rsh ) throws SQLException { return this . query ( conn , sql , new Object [ ] { param } , rsh ) ; }
Execute an SQL SELECT query with a single replacement parameter . The caller is responsible for closing the connection .
53
21
152,034
public < T > T query ( Connection conn , String sql , Object [ ] params , ResultSetHandler < T > rsh ) throws SQLException { PreparedStatement stmt = null ; ResultSet rs = null ; T result = null ; try { stmt = this . prepareStatement ( conn , sql ) ; this . fillStatement ( stmt , params ) ; rs = this . wrap ( stmt . executeQuery ( ) ) ; result = rsh . handle ( rs ) ; } catch ( SQLException e ) { this . rethrow ( e , sql , params ) ; } finally { try { close ( rs ) ; } finally { close ( stmt ) ; } } return result ; }
Execute an SQL SELECT query with replacement parameters . The caller is responsible for closing the connection .
150
19
152,035
public int update ( Connection conn , String sql ) throws SQLException { return this . update ( conn , sql , ( Object [ ] ) null ) ; }
Execute an SQL INSERT UPDATE or DELETE query without replacement parameters .
34
16
152,036
public int update ( Connection conn , String sql , Object param ) throws SQLException { return this . update ( conn , sql , new Object [ ] { param } ) ; }
Execute an SQL INSERT UPDATE or DELETE query with a single replacement parameter .
38
18
152,037
public int update ( Connection conn , String sql , Object [ ] params , int [ ] paramTypes ) throws SQLException { if ( ( paramTypes != null ) && params . length != paramTypes . length ) { throw new IllegalArgumentException ( "Sizes of params and paramTypes must be equal!" ) ; } PreparedStatement stmt = null ; int rows = 0 ; try { stmt = this . prepareStatement ( conn , sql ) ; this . fillStatement ( stmt , params , paramTypes ) ; rows = stmt . executeUpdate ( ) ; } catch ( SQLException e ) { this . rethrow ( e , sql , params ) ; } finally { close ( stmt ) ; } return rows ; }
Execute an SQL INSERT UPDATE or DELETE query .
156
13
152,038
protected void copyMergeRegions ( HSSFSheet resultSheet , String rangeName , int firstTargetRangeRow , int firstTargetRangeColumn ) { int rangeNameIdx = templateWorkbook . getNameIndex ( rangeName ) ; if ( rangeNameIdx == - 1 ) return ; HSSFName aNamedRange = templateWorkbook . getNameAt ( rangeNameIdx ) ; AreaReference aref = new AreaReference ( aNamedRange . getRefersToFormula ( ) , SpreadsheetVersion . EXCEL97 ) ; int column = aref . getFirstCell ( ) . getCol ( ) ; int row = aref . getFirstCell ( ) . getRow ( ) ; List < SheetRange > regionsList = mergeRegionsForRangeNames . get ( rangeName ) ; if ( regionsList != null ) for ( SheetRange sheetRange : regionsList ) { if ( resultSheet . getSheetName ( ) . equals ( sheetRange . getSheetName ( ) ) ) { CellRangeAddress cra = sheetRange . getCellRangeAddress ( ) ; if ( cra != null ) { int regionHeight = cra . getLastRow ( ) - cra . getFirstRow ( ) + 1 ; int regionWidth = cra . getLastColumn ( ) - cra . getFirstColumn ( ) + 1 ; int regionVOffset = cra . getFirstRow ( ) - row ; int regionHOffset = cra . getFirstColumn ( ) - column ; CellRangeAddress newRegion = cra . copy ( ) ; newRegion . setFirstColumn ( regionHOffset + firstTargetRangeColumn ) ; newRegion . setLastColumn ( regionHOffset + regionWidth - 1 + firstTargetRangeColumn ) ; newRegion . setFirstRow ( regionVOffset + firstTargetRangeRow ) ; newRegion . setLastRow ( regionVOffset + regionHeight - 1 + firstTargetRangeRow ) ; boolean skipRegion = false ; for ( int mergedIndex = 0 ; mergedIndex < resultSheet . getNumMergedRegions ( ) ; mergedIndex ++ ) { CellRangeAddress mergedRegion = resultSheet . getMergedRegion ( mergedIndex ) ; if ( ! intersects ( newRegion , mergedRegion ) ) { continue ; } skipRegion = true ; } if ( ! skipRegion ) { resultSheet . addMergedRegion ( newRegion ) ; } } } } }
Create new merge regions in result sheet identically to range s merge regions from template . Not support copy of frames and rules
508
24
152,039
private HSSFCell copyCellFromTemplate ( HSSFCell templateCell , HSSFRow resultRow , int resultColumn , BandData band ) { checkThreadInterrupted ( ) ; if ( templateCell == null ) return null ; HSSFCell resultCell = resultRow . createCell ( resultColumn ) ; HSSFCellStyle templateStyle = templateCell . getCellStyle ( ) ; HSSFCellStyle resultStyle = copyCellStyle ( templateStyle ) ; resultCell . setCellStyle ( resultStyle ) ; String templateCellValue = "" ; int cellType = templateCell . getCellType ( ) ; if ( cellType != HSSFCell . CELL_TYPE_FORMULA && cellType != HSSFCell . CELL_TYPE_NUMERIC ) { HSSFRichTextString richStringCellValue = templateCell . getRichStringCellValue ( ) ; templateCellValue = richStringCellValue != null ? richStringCellValue . getString ( ) : "" ; templateCellValue = extractStyles ( templateCell , resultCell , templateCellValue , band ) ; } if ( cellType == HSSFCell . CELL_TYPE_STRING && containsJustOneAlias ( templateCellValue ) ) { updateValueCell ( rootBand , band , templateCellValue , resultCell , drawingPatriarchsMap . get ( resultCell . getSheet ( ) ) ) ; } else { String cellValue = inlineBandDataToCellString ( templateCell , templateCellValue , band ) ; setValueToCell ( resultCell , cellValue , cellType ) ; } return resultCell ; }
copies template cell to result row into result column . Fills this cell with data from band
344
19
152,040
protected void updateValueCell ( BandData rootBand , BandData bandData , String templateCellValue , HSSFCell resultCell , HSSFPatriarch patriarch ) { String parameterName = templateCellValue ; parameterName = unwrapParameterName ( parameterName ) ; String fullParameterName = bandData . getName ( ) + "." + parameterName ; if ( StringUtils . isEmpty ( parameterName ) ) return ; if ( ! bandData . getData ( ) . containsKey ( parameterName ) ) { resultCell . setCellValue ( ( String ) null ) ; return ; } Object value = bandData . getData ( ) . get ( parameterName ) ; if ( value == null ) { resultCell . setCellType ( HSSFCell . CELL_TYPE_BLANK ) ; return ; } String formatString = getFormatString ( parameterName , fullParameterName ) ; InlinerAndMatcher inlinerAndMatcher = getContentInlinerForFormat ( formatString ) ; if ( inlinerAndMatcher != null ) { inlinerAndMatcher . contentInliner . inlineToXls ( patriarch , resultCell , value , inlinerAndMatcher . matcher ) ; return ; } if ( formatString != null ) { resultCell . setCellValue ( new HSSFRichTextString ( formatValue ( value , parameterName , fullParameterName ) ) ) ; } else if ( value instanceof Number ) { resultCell . setCellValue ( ( ( Number ) value ) . doubleValue ( ) ) ; } else if ( value instanceof Boolean ) { resultCell . setCellValue ( ( Boolean ) value ) ; } else if ( value instanceof Date ) { resultCell . setCellValue ( ( Date ) value ) ; } else { resultCell . setCellValue ( new HSSFRichTextString ( formatValue ( value , parameterName , fullParameterName ) ) ) ; } }
Copies template cell to result cell and fills it with bandData data
406
14
152,041
protected void addRangeBounds ( BandData band , CellReference [ ] crefs ) { if ( templateBounds . containsKey ( band . getName ( ) ) ) return ; Bounds bounds = new Bounds ( crefs [ 0 ] . getRow ( ) , crefs [ 0 ] . getCol ( ) , crefs [ crefs . length - 1 ] . getRow ( ) , crefs [ crefs . length - 1 ] . getCol ( ) ) ; templateBounds . put ( band . getName ( ) , bounds ) ; }
This method adds range bounds to cache . Key is bandName
118
12
152,042
protected EscherAggregate getEscherAggregate ( HSSFSheet sheet ) { EscherAggregate agg = sheetToEscherAggregate . get ( sheet . getSheetName ( ) ) ; if ( agg == null ) { agg = sheet . getDrawingEscherAggregate ( ) ; sheetToEscherAggregate . put ( sheet . getSheetName ( ) , agg ) ; } return agg ; }
Returns EscherAggregate from sheet
91
7
152,043
protected void copyPicturesFromTemplateToResult ( HSSFSheet templateSheet , HSSFSheet resultSheet ) { List < HSSFClientAnchor > list = getAllAnchors ( getEscherAggregate ( templateSheet ) ) ; int i = 0 ; if ( CollectionUtils . isNotEmpty ( orderedPicturesId ) ) { //just a shitty workaround for anchors without pictures for ( HSSFClientAnchor anchor : list ) { Cell topLeft = getCellFromTemplate ( new Cell ( anchor . getCol1 ( ) , anchor . getRow1 ( ) ) ) ; anchor . setCol1 ( topLeft . getCol ( ) ) ; anchor . setRow1 ( topLeft . getRow ( ) ) ; anchor . setCol2 ( topLeft . getCol ( ) + anchor . getCol2 ( ) - anchor . getCol1 ( ) ) ; anchor . setRow2 ( topLeft . getRow ( ) + anchor . getRow2 ( ) - anchor . getRow1 ( ) ) ; HSSFPatriarch sheetPatriarch = drawingPatriarchsMap . get ( resultSheet ) ; if ( sheetPatriarch != null ) { sheetPatriarch . createPicture ( anchor , orderedPicturesId . get ( i ++ ) ) ; } } } }
Copies all pictures from template sheet to result sheet shift picture depending on area dependencies
285
16
152,044
protected void updateFormulas ( ) { CTCalcChain calculationChain = getCalculationChain ( ) ; int formulaCount = processInnerFormulas ( calculationChain ) ; processOuterFormulas ( formulaCount , calculationChain ) ; }
todo support formulas without range but with list of cells
51
11
152,045
protected void createFakeTemplateCellsForEmptyOnes ( Range oneRowRange , Map < CellReference , Cell > cellsForOneRowRange , List < Cell > templateCells ) { if ( oneRowRange . toCellReferences ( ) . size ( ) != templateCells . size ( ) ) { final HashBiMap < CellReference , Cell > referencesToCells = HashBiMap . create ( cellsForOneRowRange ) ; for ( CellReference cellReference : oneRowRange . toCellReferences ( ) ) { if ( ! cellsForOneRowRange . containsKey ( cellReference ) ) { Cell newCell = Context . getsmlObjectFactory ( ) . createCell ( ) ; newCell . setV ( null ) ; newCell . setT ( STCellType . STR ) ; newCell . setR ( cellReference . toReference ( ) ) ; templateCells . add ( newCell ) ; referencesToCells . put ( cellReference , newCell ) ; } } templateCells . sort ( ( o1 , o2 ) -> { CellReference cellReference1 = referencesToCells . inverse ( ) . get ( o1 ) ; CellReference cellReference2 = referencesToCells . inverse ( ) . get ( o2 ) ; return cellReference1 . compareTo ( cellReference2 ) ; } ) ; } }
XLSX document does not store empty cells and it might be an issue for formula calculations and etc . So we need to create fake template cell for each empty cell .
283
34
152,046
public RunParams templateCode ( String templateCode ) { if ( templateCode == null ) { throw new NullPointerException ( "\"templateCode\" parameter can not be null" ) ; } this . reportTemplate = report . getReportTemplates ( ) . get ( templateCode ) ; if ( reportTemplate == null ) { throw new NullPointerException ( String . format ( "Report template not found for code [%s]" , templateCode ) ) ; } return this ; }
Setup necessary template by string code . Throws validation exception if code is null or template not found
102
19
152,047
public RunParams params ( Map < String , Object > params ) { if ( params == null ) { throw new NullPointerException ( "\"params\" parameter can not be null" ) ; } this . params . putAll ( params ) ; return this ; }
Adds parameters from map
56
4
152,048
public RunParams param ( String key , Object value ) { params . put ( key , value ) ; return this ; }
Add single parameter
26
3
152,049
public BoxRequestsCollections . GetCollections getCollectionsRequest ( ) { BoxRequestsCollections . GetCollections request = new BoxRequestsCollections . GetCollections ( getCollectionsUrl ( ) , mSession ) ; return request ; }
Gets a request that gets the collections belonging to the user
54
12
152,050
public BoxRequestsCollections . GetCollectionItems getItemsRequest ( String id ) { BoxRequestsCollections . GetCollectionItems request = new BoxRequestsCollections . GetCollectionItems ( id , getCollectionItemsUrl ( id ) , mSession ) ; return request ; }
Gets a request that gets the items of a collection
58
11
152,051
public static BoxUser createFromId ( String userId ) { JsonObject object = new JsonObject ( ) ; object . add ( BoxCollaborator . FIELD_ID , userId ) ; object . add ( BoxCollaborator . FIELD_TYPE , BoxUser . TYPE ) ; BoxUser user = new BoxUser ( ) ; user . createFromJson ( object ) ; return user ; }
A convenience method to create an empty user with just the id and type fields set . This allows the ability to interact with the content sdk in a more descriptive and type safe manner
87
36
152,052
public BoxRequestsEvent . GetUserEvents getUserEventsRequest ( ) { BoxRequestsEvent . GetUserEvents request = new BoxRequestsEvent . GetUserEvents ( getEventsUrl ( ) , mSession ) ; return request ; }
Gets a request that retrieves user events
50
9
152,053
public BoxRequestsEvent . GetEnterpriseEvents getEnterpriseEventsRequest ( ) { BoxRequestsEvent . GetEnterpriseEvents request = new BoxRequestsEvent . GetEnterpriseEvents ( getEventsUrl ( ) , mSession ) ; return request ; }
Gets a request that retrieves enterprise events
54
9
152,054
public RealTimeServerConnection getLongPollServerConnection ( RealTimeServerConnection . OnChangeListener changeListener ) { BoxRequestsEvent . EventRealTimeServerRequest request = new BoxRequestsEvent . EventRealTimeServerRequest ( getEventsUrl ( ) , mSession ) ; return new RealTimeServerConnection ( request , changeListener , mSession ) ; }
Gets a request that retrieves a RealTimeServerConnection which is used to create a long poll to check for some generic change to the user s account . This can be combined with syncing logic using getUserEventsRequest or getEnterpriseEventsRequest to discover what has changed .
74
57
152,055
public JsonValue getPropertyValue ( String name ) { // Return a copy of json value to ensure user can't change the underlying object directly JsonValue jsonValue = mCacheMap . getAsJsonValue ( name ) ; return jsonValue == null ? null : JsonValue . readFrom ( jsonValue . toString ( ) ) ; }
Gets the value associated with the key in the property map
73
12
152,056
public R setMessage ( String message ) { mBodyMap . put ( BoxComment . FIELD_MESSAGE , message ) ; return ( R ) this ; }
Sets the message used in the request to create a new comment .
36
14
152,057
public String getItemId ( ) { return mBodyMap . containsKey ( BoxComment . FIELD_ITEM ) ? ( String ) mBodyMap . get ( BoxItem . FIELD_ID ) : null ; }
Returns the id of the item currently set in the request to add a comment to .
47
17
152,058
protected R setItemId ( String id ) { JsonObject object = new JsonObject ( ) ; if ( mBodyMap . containsKey ( BoxComment . FIELD_ITEM ) ) { BoxEntity item = ( BoxEntity ) mBodyMap . get ( BoxComment . FIELD_ITEM ) ; object = item . toJsonObject ( ) ; } object . add ( BoxEntity . FIELD_ID , id ) ; BoxEntity item = new BoxEntity ( object ) ; mBodyMap . put ( BoxComment . FIELD_ITEM , item ) ; return ( R ) this ; }
Sets the id of the item used in the request to add a comment to .
129
17
152,059
public String getItemType ( ) { return mBodyMap . containsKey ( BoxComment . FIELD_ITEM ) ? ( String ) mBodyMap . get ( BoxItem . FIELD_TYPE ) : null ; }
Returns the type of item used in the request to add a comment to .
47
15
152,060
protected R setItemType ( String type ) { JsonObject object = new JsonObject ( ) ; if ( mBodyMap . containsKey ( BoxComment . FIELD_ITEM ) ) { BoxEntity item = ( BoxEntity ) mBodyMap . get ( BoxComment . FIELD_ITEM ) ; object = item . toJsonObject ( ) ; } object . add ( BoxEntity . FIELD_TYPE , type ) ; BoxEntity item = new BoxEntity ( object ) ; mBodyMap . put ( BoxComment . FIELD_ITEM , item ) ; return ( R ) this ; }
Sets the type of item used in the request to add a comment to .
129
16
152,061
public void open ( ) throws IOException { mConnection . connect ( ) ; mContentType = mConnection . getContentType ( ) ; mResponseCode = mConnection . getResponseCode ( ) ; mContentEncoding = mConnection . getContentEncoding ( ) ; }
Open connection to the resource .
58
6
152,062
public R setLimit ( int limit ) { mQueryMap . put ( LIMIT , String . valueOf ( limit ) ) ; return ( R ) this ; }
Sets the limit of items that should be returned
34
10
152,063
public R setOffset ( int offset ) { mQueryMap . put ( OFFSET , String . valueOf ( offset ) ) ; return ( R ) this ; }
Sets the offset of the items that should be returned
35
11
152,064
protected String getBaseUri ( ) { if ( mSession != null && mSession . getAuthInfo ( ) != null && mSession . getAuthInfo ( ) . getBaseDomain ( ) != null ) { return String . format ( BoxConstants . BASE_URI_TEMPLATE , mSession . getAuthInfo ( ) . getBaseDomain ( ) ) ; } return mBaseUri ; }
Returns the base URI for the API .
87
8
152,065
protected String getBaseUploadUri ( ) { if ( mSession != null && mSession . getAuthInfo ( ) != null && mSession . getAuthInfo ( ) . getBaseDomain ( ) != null ) { return String . format ( BoxConstants . BASE_UPLOAD_URI_TEMPLATE , mSession . getAuthInfo ( ) . getBaseDomain ( ) ) ; } return mBaseUploadUri ; }
Returns the base URI for uploads for the API .
93
11
152,066
public ArrayList < BoxCollaboration . Role > getAllowedInviteeRoles ( ) { if ( mCachedAllowedInviteeRoles != null ) { return mCachedAllowedInviteeRoles ; } ArrayList < String > roles = getPropertyAsStringArray ( FIELD_ALLOWED_INVITEE_ROLES ) ; if ( roles == null ) { return null ; } mCachedAllowedInviteeRoles = new ArrayList < BoxCollaboration . Role > ( roles . size ( ) ) ; for ( String role : roles ) { mCachedAllowedInviteeRoles . add ( BoxCollaboration . Role . fromString ( role ) ) ; } return mCachedAllowedInviteeRoles ; }
Item collaboration settings allowed by the enterprise administrator .
171
9
152,067
public Map < String , String > getEndpointsMap ( ) { List < String > keys = getPropertiesKeySet ( ) ; HashMap < String , String > endpoints = new HashMap <> ( keys . size ( ) ) ; for ( String key : keys ) { endpoints . put ( key , getPropertyAsString ( key ) ) ; } return endpoints ; }
Get a map of all end points
81
7
152,068
public static BoxGroup createFromId ( String groupId ) { JsonObject object = new JsonObject ( ) ; object . add ( BoxCollaborator . FIELD_ID , groupId ) ; object . add ( BoxCollaborator . FIELD_TYPE , BoxUser . TYPE ) ; return new BoxGroup ( object ) ; }
A convenience method to create an empty group with just the id and type fields set . This allows the ability to interact with the content sdk in a more descriptive and type safe manner
72
36
152,069
public BoxRequestsMetadata . AddItemMetadata getAddFolderMetadataRequest ( String id , LinkedHashMap < String , Object > values , String scope , String template ) { BoxRequestsMetadata . AddItemMetadata request = new BoxRequestsMetadata . AddItemMetadata ( values , getFolderMetadataUrl ( id , scope , template ) , mSession ) ; return request ; }
Gets a request that adds metadata to a folder
86
10
152,070
public BoxRequestsMetadata . GetItemMetadata getFolderMetadataRequest ( String id , String template ) { BoxRequestsMetadata . GetItemMetadata request = new BoxRequestsMetadata . GetItemMetadata ( getFolderMetadataUrl ( id , template ) , mSession ) ; return request ; }
Gets a request that retrieves the metadata for a specific template on a folder
67
16
152,071
public BoxRequestsMetadata . UpdateFileMetadata getUpdateFileMetadataRequest ( String id , String scope , String template ) { BoxRequestsMetadata . UpdateFileMetadata request = new BoxRequestsMetadata . UpdateFileMetadata ( getFileMetadataUrl ( id , scope , template ) , mSession ) ; return request ; }
Gets a request that updates the metadata for a specific template on a file
73
15
152,072
public BoxRequestsMetadata . UpdateItemMetadata getUpdateFolderMetadataRequest ( String id , String scope , String template ) { BoxRequestsMetadata . UpdateItemMetadata request = new BoxRequestsMetadata . UpdateItemMetadata ( getFolderMetadataUrl ( id , scope , template ) , mSession ) ; return request ; }
Gets a request that updates the metadata for a specific template on a folder
73
15
152,073
public BoxRequestsMetadata . DeleteFileMetadata getDeleteFileMetadataTemplateRequest ( String id , String template ) { BoxRequestsMetadata . DeleteFileMetadata request = new BoxRequestsMetadata . DeleteFileMetadata ( getFileMetadataUrl ( id , template ) , mSession ) ; return request ; }
Gets a request that deletes the metadata for a specific template on a file
69
16
152,074
public BoxRequestsMetadata . DeleteItemMetadata getDeleteFolderMetadataTemplateRequest ( String id , String template ) { BoxRequestsMetadata . DeleteItemMetadata request = new BoxRequestsMetadata . DeleteItemMetadata ( getFolderMetadataUrl ( id , template ) , mSession ) ; return request ; }
Gets a request that deletes the metadata for a specific template on a folder
69
16
152,075
public BoxRequestsMetadata . GetMetadataTemplates getMetadataTemplatesRequest ( ) { BoxRequestsMetadata . GetMetadataTemplates request = new BoxRequestsMetadata . GetMetadataTemplates ( getMetadataTemplatesUrl ( ) , mSession ) ; return request ; }
Gets a request that retrieves available metadata templates under the enterprise scope
64
14
152,076
public BoxFutureTask < BoxSession > logout ( ) { final BoxFutureTask < BoxSession > task = ( new BoxSessionLogoutRequest ( this ) ) . toTask ( ) ; new Thread ( ) { @ Override public void run ( ) { task . run ( ) ; } } . start ( ) ; return task ; }
Logout the currently authenticated user .
71
7
152,077
public BoxFutureTask < BoxSession > refresh ( ) { if ( mRefreshTask != null && mRefreshTask . get ( ) != null ) { BoxFutureTask < BoxSession > lastRefreshTask = mRefreshTask . get ( ) ; if ( ! ( lastRefreshTask . isCancelled ( ) || lastRefreshTask . isDone ( ) ) ) { return lastRefreshTask ; } } final BoxFutureTask < BoxSession > task = ( new BoxSessionRefreshRequest ( this ) ) . toTask ( ) ; new Thread ( ) { @ Override public void run ( ) { task . run ( ) ; } } . start ( ) ; mRefreshTask = new WeakReference < BoxFutureTask < BoxSession > > ( task ) ; return task ; }
Refresh authentication information associated with this session .
169
9
152,078
@ Override public void onRefreshed ( BoxAuthentication . BoxAuthenticationInfo info ) { if ( sameUser ( info ) ) { BoxAuthentication . BoxAuthenticationInfo . cloneInfo ( mAuthInfo , info ) ; if ( sessionAuthListener != null ) { sessionAuthListener . onRefreshed ( info ) ; } } }
Called when this session has been refreshed with new authentication info .
73
13
152,079
@ Override public void onAuthCreated ( BoxAuthentication . BoxAuthenticationInfo info ) { if ( sameUser ( info ) || getUserId ( ) == null ) { BoxAuthentication . BoxAuthenticationInfo . cloneInfo ( mAuthInfo , info ) ; if ( info . getUser ( ) != null ) { setUserId ( info . getUser ( ) . getId ( ) ) ; } if ( sessionAuthListener != null ) { sessionAuthListener . onAuthCreated ( info ) ; } } }
Called when this user has logged in .
109
9
152,080
@ Override public void onAuthFailure ( BoxAuthentication . BoxAuthenticationInfo info , Exception ex ) { if ( sameUser ( info ) || ( info == null && getUserId ( ) == null ) ) { if ( sessionAuthListener != null ) { sessionAuthListener . onAuthFailure ( info , ex ) ; } if ( ex instanceof BoxException ) { BoxException . ErrorType errorType = ( ( BoxException ) ex ) . getErrorType ( ) ; switch ( errorType ) { case NETWORK_ERROR : toastString ( mApplicationContext , R . string . boxsdk_error_network_connection ) ; break ; case IP_BLOCKED : } } } }
Called when a failure occurs trying to authenticate or refresh .
146
13
152,081
public String getName ( ) { return mBodyMap . containsKey ( BoxItem . FIELD_NAME ) ? ( String ) mBodyMap . get ( BoxItem . FIELD_NAME ) : null ; }
Returns the name currently set for the item copy .
45
10
152,082
public R setName ( String name ) { mBodyMap . put ( BoxItem . FIELD_NAME , name ) ; return ( R ) this ; }
Sets the name used in the request for the item copy .
33
13
152,083
public String getParentId ( ) { return mBodyMap . containsKey ( BoxItem . FIELD_PARENT ) ? ( ( BoxFolder ) mBodyMap . get ( BoxItem . FIELD_PARENT ) ) . getId ( ) : null ; }
Returns the parent id currently set for the item copy .
56
11
152,084
public R setParentId ( String parentId ) { BoxFolder parentFolder = BoxFolder . createFromId ( parentId ) ; mBodyMap . put ( BoxItem . FIELD_PARENT , parentFolder ) ; return ( R ) this ; }
Sets the parent id used in the request for the item copy .
53
14
152,085
public void setPartsSha1 ( List < String > sha1s ) { JsonArray jsonArray = new JsonArray ( ) ; for ( String s : sha1s ) { jsonArray . add ( s ) ; } set ( FIELD_PARTS_SHA1 , jsonArray ) ; }
Util method for storing sha1 for parts being uploaded
67
12
152,086
public static int getChunkSize ( BoxUploadSession uploadSession , int partNumber , long fileSize ) { if ( partNumber == uploadSession . getTotalParts ( ) - 1 ) { return ( int ) ( fileSize - partNumber * uploadSession . getPartSize ( ) ) ; } return uploadSession . getPartSize ( ) ; }
Computes the actual bytes to be sent in a part which equals the partsize for all parts except the last .
73
23
152,087
public BoxIterator < BoxFolder > getPathCollection ( ) { return ( BoxIterator < BoxFolder > ) getPropertyAsJsonObject ( BoxJsonObject . getBoxJsonObjectCreator ( BoxIteratorBoxEntity . class ) , FIELD_PATH_COLLECTION ) ; }
Gets the path of folders to the item starting at the root .
61
14
152,088
@ Deprecated public static BoxItem createBoxItemFromJson ( final String json ) { BoxEntity createdByEntity = new BoxEntity ( ) ; createdByEntity . createFromJson ( json ) ; if ( createdByEntity . getType ( ) . equals ( BoxFile . TYPE ) ) { BoxFile file = new BoxFile ( ) ; file . createFromJson ( json ) ; return file ; } else if ( createdByEntity . getType ( ) . equals ( BoxBookmark . TYPE ) ) { BoxBookmark bookmark = new BoxBookmark ( ) ; bookmark . createFromJson ( json ) ; return bookmark ; } else if ( createdByEntity . getType ( ) . equals ( BoxFolder . TYPE ) ) { BoxFolder folder = new BoxFolder ( ) ; folder . createFromJson ( json ) ; return folder ; } return null ; }
Deprecated use BoxEntity . createEntityFromJson . FromCreates a BoxItem object from a JSON string .
184
24
152,089
protected String getUploadSessionForNewFileVersionUrl ( final String id ) { return String . format ( Locale . ENGLISH , "%s/files/%s/upload_sessions" , getBaseUploadUri ( ) , id ) ; }
Get the URL for uploading file a new version of a file in chunks
54
14
152,090
public BoxRequestsFile . GetFileInfo getInfoRequest ( final String id ) { BoxRequestsFile . GetFileInfo request = new BoxRequestsFile . GetFileInfo ( id , getFileInfoUrl ( id ) , mSession ) ; return request ; }
Gets a request that retrieves information on a file
56
11
152,091
public BoxRequestsFile . GetEmbedLinkFileInfo getEmbedLinkRequest ( final String id ) { BoxRequestsFile . GetEmbedLinkFileInfo request = new BoxRequestsFile . GetEmbedLinkFileInfo ( id , getFileInfoUrl ( id ) , mSession ) ; return request ; }
Gets a request that retrieves an expiring embedded link which can be embedded in a webview for a preview .
67
24
152,092
public BoxRequestsFile . UpdateFile getUpdateRequest ( String id ) { BoxRequestsFile . UpdateFile request = new BoxRequestsFile . UpdateFile ( id , getFileInfoUrl ( id ) , mSession ) ; return request ; }
Gets a request that updates a file s information
52
10
152,093
public BoxRequestsFile . CopyFile getCopyRequest ( String id , String parentId ) { BoxRequestsFile . CopyFile request = new BoxRequestsFile . CopyFile ( id , parentId , getFileCopyUrl ( id ) , mSession ) ; return request ; }
Gets a request that copies a file
59
8
152,094
public BoxRequestsFile . UpdateFile getRenameRequest ( String id , String newName ) { BoxRequestsFile . UpdateFile request = new BoxRequestsFile . UpdateFile ( id , getFileInfoUrl ( id ) , mSession ) ; request . setName ( newName ) ; return request ; }
Gets a request that renames a file
66
9
152,095
public BoxRequestsFile . UpdateFile getMoveRequest ( String id , String parentId ) { BoxRequestsFile . UpdateFile request = new BoxRequestsFile . UpdateFile ( id , getFileInfoUrl ( id ) , mSession ) ; request . setParentId ( parentId ) ; return request ; }
Gets a request that moves a file to another folder
66
11
152,096
public BoxRequestsFile . UpdatedSharedFile getCreateSharedLinkRequest ( String id ) { BoxRequestsFile . UpdatedSharedFile request = new BoxRequestsFile . UpdatedSharedFile ( id , getFileInfoUrl ( id ) , mSession ) . setAccess ( null ) ; return request ; }
Gets a request that creates a shared link for a file
67
12
152,097
public BoxRequestsFile . AddCommentToFile getAddCommentRequest ( String fileId , String message ) { BoxRequestsFile . AddCommentToFile request = new BoxRequestsFile . AddCommentToFile ( fileId , message , getCommentUrl ( ) , mSession ) ; return request ; }
Gets a request that adds a comment to a file
64
11
152,098
public BoxRequestsFile . AddTaggedCommentToFile getAddTaggedCommentRequest ( String fileId , String taggedMessage ) { BoxRequestsFile . AddTaggedCommentToFile request = new BoxRequestsFile . AddTaggedCommentToFile ( fileId , taggedMessage , getCommentUrl ( ) , mSession ) ; return request ; }
Gets a request for adding a comment with tags that mention users . The server will notify mentioned users of the comment .
74
24
152,099
public BoxRequestsFile . UploadFile getUploadRequest ( InputStream fileInputStream , String fileName , String destinationFolderId ) { BoxRequestsFile . UploadFile request = new BoxRequestsFile . UploadFile ( fileInputStream , fileName , destinationFolderId , getFileUploadUrl ( ) , mSession ) ; return request ; }
Gets a request that uploads a file from an input stream
72
13