idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
152,300
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 .
152,301
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 .
152,302
public void configureCoreProperties ( Project project , AppEngineCoreExtensionProperties appEngineCoreExtensionProperties , String taskGroup , boolean requiresAppEngineJava ) { project . getLogger ( ) . warn ( "WARNING: You are a using release candidate " + getClass ( ) . getPackage ( ) . getImplementationVersion ( ) +...
Configure core tasks for appengine app . yaml and appengine - web . xml based project plugins .
152,303
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...
Check if vm = true .
152,304
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 .
152,305
@ 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 ; }
Get an extension by it s path potentially will throw all kinds of exceptions . Be very careful .
152,306
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
152,307
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 ) ; o...
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
152,308
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 } ; t...
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 .
152,309
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 .
152,310
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 .
152,311
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 .
152,312
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
152,313
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 .
152,314
public XComponentContext connect ( String oooConnectionString ) throws BootstrapException { this . oooConnectionString = oooConnectionString ; XComponentContext xContext = null ; try { XComponentContext xLocalContext = getLocalContext ( ) ; oooServer . start ( ) ; XMultiComponentFactory xLocalServiceManager = xLocalCon...
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 .
152,315
public void disconnect ( ) { if ( oooConnectionString == null ) return ; try { XComponentContext xLocalContext = getLocalContext ( ) ; XUnoUrlResolver xUrlResolver = UnoUrlResolver . create ( xLocalContext ) ; XComponentContext xRemoteContext = getRemoteContext ( xUrlResolver ) ; Object desktop = xRemoteContext . getSe...
Disconnects from an OOo server using the connection string from the previous connect .
152,316
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 .
152,317
protected XComponentContext getRemoteContext ( XUnoUrlResolver xUrlResolver ) throws BootstrapException , ConnectionSetupException , IllegalArgumentException , NoConnectException { Object context = xUrlResolver . resolve ( oooConnectionString ) ; XComponentContext xContext = ( XComponentContext ) UnoRuntime . queryInte...
Try to connect to office .
152,318
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...
Maintains visitedBands to continue bypass on the same level after return from deeper level of hierarchy . Creates iterator for each level .
152,319
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 JRBand...
Search for first level children band with specified name and return new datasource with this band as root element .
152,320
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 .
152,321
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 . ex...
Execute an SQL SELECT query with replacement parameters . The caller is responsible for closing the connection .
152,322
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 .
152,323
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 .
152,324
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 ...
Execute an SQL INSERT UPDATE or DELETE query .
152,325
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 ) ; AreaReferenc...
Create new merge regions in result sheet identically to range s merge regions from template . Not support copy of frames and rules
152,326
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 ( ) ; ...
copies template cell to result row into result column . Fills this cell with data from band
152,327
protected void updateValueCell ( BandData rootBand , BandData bandData , String templateCellValue , HSSFCell resultCell , HSSFPatriarch patriarch ) { String parameterName = templateCellValue ; parameterName = unwrapParameterName ( parameterName ) ; String fullParameterName = bandData . getName ( ) + "." + parameterName...
Copies template cell to result cell and fills it with bandData data
152,328
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 ( ) ) ; tem...
This method adds range bounds to cache . Key is bandName
152,329
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
152,330
protected void copyPicturesFromTemplateToResult ( HSSFSheet templateSheet , HSSFSheet resultSheet ) { List < HSSFClientAnchor > list = getAllAnchors ( getEscherAggregate ( templateSheet ) ) ; int i = 0 ; if ( CollectionUtils . isNotEmpty ( orderedPicturesId ) ) { for ( HSSFClientAnchor anchor : list ) { Cell topLeft = ...
Copies all pictures from template sheet to result sheet shift picture depending on area dependencies
152,331
protected void updateFormulas ( ) { CTCalcChain calculationChain = getCalculationChain ( ) ; int formulaCount = processInnerFormulas ( calculationChain ) ; processOuterFormulas ( formulaCount , calculationChain ) ; }
todo support formulas without range but with list of cells
152,332
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 (...
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 .
152,333
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 ( Stri...
Setup necessary template by string code . Throws validation exception if code is null or template not found
152,334
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
152,335
public RunParams param ( String key , Object value ) { params . put ( key , value ) ; return this ; }
Add single parameter
152,336
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
152,337
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
152,338
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
152,339
public BoxRequestsEvent . GetUserEvents getUserEventsRequest ( ) { BoxRequestsEvent . GetUserEvents request = new BoxRequestsEvent . GetUserEvents ( getEventsUrl ( ) , mSession ) ; return request ; }
Gets a request that retrieves user events
152,340
public BoxRequestsEvent . GetEnterpriseEvents getEnterpriseEventsRequest ( ) { BoxRequestsEvent . GetEnterpriseEvents request = new BoxRequestsEvent . GetEnterpriseEvents ( getEventsUrl ( ) , mSession ) ; return request ; }
Gets a request that retrieves enterprise events
152,341
public RealTimeServerConnection getLongPollServerConnection ( RealTimeServerConnection . OnChangeListener changeListener ) { BoxRequestsEvent . EventRealTimeServerRequest request = new BoxRequestsEvent . EventRealTimeServerRequest ( getEventsUrl ( ) , mSession ) ; return new RealTimeServerConnection ( request , changeL...
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 .
152,342
public JsonValue getPropertyValue ( String name ) { JsonValue jsonValue = mCacheMap . getAsJsonValue ( name ) ; return jsonValue == null ? null : JsonValue . readFrom ( jsonValue . toString ( ) ) ; }
Gets the value associated with the key in the property map
152,343
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 .
152,344
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 .
152,345
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 Bo...
Sets the id of the item used in the request to add a comment to .
152,346
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 .
152,347
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 ...
Sets the type of item used in the request to add a comment to .
152,348
public void open ( ) throws IOException { mConnection . connect ( ) ; mContentType = mConnection . getContentType ( ) ; mResponseCode = mConnection . getResponseCode ( ) ; mContentEncoding = mConnection . getContentEncoding ( ) ; }
Open connection to the resource .
152,349
public R setLimit ( int limit ) { mQueryMap . put ( LIMIT , String . valueOf ( limit ) ) ; return ( R ) this ; }
Sets the limit of items that should be returned
152,350
public R setOffset ( int offset ) { mQueryMap . put ( OFFSET , String . valueOf ( offset ) ) ; return ( R ) this ; }
Sets the offset of the items that should be returned
152,351
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 .
152,352
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 .
152,353
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 Arra...
Item collaboration settings allowed by the enterprise administrator .
152,354
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
152,355
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
152,356
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 ) , mSess...
Gets a request that adds metadata to a folder
152,357
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
152,358
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
152,359
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
152,360
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
152,361
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
152,362
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
152,363
public BoxFutureTask < BoxSession > logout ( ) { final BoxFutureTask < BoxSession > task = ( new BoxSessionLogoutRequest ( this ) ) . toTask ( ) ; new Thread ( ) { public void run ( ) { task . run ( ) ; } } . start ( ) ; return task ; }
Logout the currently authenticated user .
152,364
public BoxFutureTask < BoxSession > refresh ( ) { if ( mRefreshTask != null && mRefreshTask . get ( ) != null ) { BoxFutureTask < BoxSession > lastRefreshTask = mRefreshTask . get ( ) ; if ( ! ( lastRefreshTask . isCancelled ( ) || lastRefreshTask . isDone ( ) ) ) { return lastRefreshTask ; } } final BoxFutureTask < Bo...
Refresh authentication information associated with this session .
152,365
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 .
152,366
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 !=...
Called when this user has logged in .
152,367
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 er...
Called when a failure occurs trying to authenticate or refresh .
152,368
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 .
152,369
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 .
152,370
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 .
152,371
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 .
152,372
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
152,373
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 .
152,374
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 .
152,375
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 ( c...
Deprecated use BoxEntity . createEntityFromJson . FromCreates a BoxItem object from a JSON string .
152,376
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
152,377
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
152,378
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 .
152,379
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
152,380
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
152,381
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
152,382
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
152,383
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
152,384
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
152,385
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 .
152,386
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
152,387
public BoxRequestsFile . UploadFile getUploadRequest ( File file , String destinationFolderId ) { BoxRequestsFile . UploadFile request = new BoxRequestsFile . UploadFile ( file , destinationFolderId , getFileUploadUrl ( ) , mSession ) ; return request ; }
Gets a request that uploads a file from an existing file
152,388
public BoxRequestsFile . UploadNewVersion getUploadNewVersionRequest ( InputStream fileInputStream , String destinationFileId ) { BoxRequestsFile . UploadNewVersion request = new BoxRequestsFile . UploadNewVersion ( fileInputStream , getFileUploadNewVersionUrl ( destinationFileId ) , mSession ) ; return request ; }
Gets a request that uploads a new file version from an input stream
152,389
public BoxRequestsFile . UploadNewVersion getUploadNewVersionRequest ( File file , String destinationFileId ) { try { BoxRequestsFile . UploadNewVersion request = getUploadNewVersionRequest ( new FileInputStream ( file ) , destinationFileId ) ; request . setUploadSize ( file . length ( ) ) ; request . setModifiedDate (...
Gets a request that uploads a new file version from an existing file
152,390
public BoxRequestsFile . DownloadFile getDownloadRequest ( File target , String fileId ) throws IOException { if ( ! target . exists ( ) ) { throw new FileNotFoundException ( ) ; } BoxRequestsFile . DownloadFile request = new BoxRequestsFile . DownloadFile ( fileId , target , getFileDownloadUrl ( fileId ) , mSession ) ...
Gets a request that downloads a given file to a target file
152,391
public BoxRequestsFile . DownloadFile getDownloadUrlRequest ( File target , String url ) throws IOException { if ( ! target . exists ( ) ) { throw new FileNotFoundException ( ) ; } BoxRequestsFile . DownloadFile request = new BoxRequestsFile . DownloadFile ( target , url , mSession ) ; return request ; }
Gets a request that downloads a given asset from the url to a target file This is used to download miscellaneous url assets for instance from the representations endpoint .
152,392
public BoxRequestsFile . DownloadFile getDownloadRequest ( OutputStream outputStream , String fileId ) { BoxRequestsFile . DownloadFile request = new BoxRequestsFile . DownloadFile ( fileId , outputStream , getFileDownloadUrl ( fileId ) , mSession ) ; return request ; }
Gets a request that downloads the given file to the provided outputStream . Developer is responsible for closing the outputStream provided .
152,393
public BoxRequestsFile . DownloadThumbnail getDownloadThumbnailRequest ( File target , String fileId ) throws IOException { if ( ! target . exists ( ) ) { throw new FileNotFoundException ( ) ; } if ( target . isDirectory ( ) ) { throw new RuntimeException ( "This endpoint only supports files and does not support direct...
Gets a request that downloads a thumbnail to a target file
152,394
public BoxRequestsFile . DownloadThumbnail getDownloadThumbnailRequest ( OutputStream outputStream , String fileId ) { BoxRequestsFile . DownloadThumbnail request = new BoxRequestsFile . DownloadThumbnail ( fileId , outputStream , getThumbnailFileDownloadUrl ( fileId ) , mSession ) ; return request ; }
Gets a request that downloads the given file thumbnail to the provided outputStream . Developer is responsible for closing the outputStream provided .
152,395
public BoxRequestsFile . DownloadRepresentation getDownloadRepresentationRequest ( String id , File targetFile , BoxRepresentation representation ) { return new BoxRequestsFile . DownloadRepresentation ( id , targetFile , representation , mSession ) ; }
Gets a request to download a representation object for a given file representation
152,396
public BoxRequestsFile . GetTrashedFile getTrashedFileRequest ( String id ) { BoxRequestsFile . GetTrashedFile request = new BoxRequestsFile . GetTrashedFile ( id , getTrashedFileUrl ( id ) , mSession ) ; return request ; }
Gets a request that returns a file in the trash
152,397
public BoxRequestsFile . DeleteTrashedFile getDeleteTrashedFileRequest ( String id ) { BoxRequestsFile . DeleteTrashedFile request = new BoxRequestsFile . DeleteTrashedFile ( id , getTrashedFileUrl ( id ) , mSession ) ; return request ; }
Gets a request that permanently deletes a file from the trash
152,398
public BoxRequestsFile . RestoreTrashedFile getRestoreTrashedFileRequest ( String id ) { BoxRequestsFile . RestoreTrashedFile request = new BoxRequestsFile . RestoreTrashedFile ( id , getFileInfoUrl ( id ) , mSession ) ; return request ; }
Gets a request that restores a trashed file
152,399
public BoxRequestsFile . GetFileComments getCommentsRequest ( String id ) { BoxRequestsFile . GetFileComments request = new BoxRequestsFile . GetFileComments ( id , getFileCommentsUrl ( id ) , mSession ) ; return request ; }
Gets a request that retrieves the comments on a file