This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using BoxOAuth.Models; | |
using Microsoft.Extensions.Options; | |
using Box.V2.Config; | |
using Box.V2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Require the Box SDK and the fs module | |
const box = require('box-node-sdk'); | |
const fs = require('fs'); | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
// Initialize the SDK with the Box configuration file and create a client that uses the Service Account. | |
let session = box.getPreconfiguredInstance(configFile); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const box = require('box-node-sdk'); | |
const fs = require('fs'); | |
const util = require('util'); | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
let session = box.getPreconfiguredInstance(configFile); | |
let serviceAccountClient = session.getAppAuthClient("enterprise"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.box; | |
import com.box.sdk.BoxConfig; | |
import com.box.sdk.BoxDeveloperEditionAPIConnection; | |
import com.box.sdk.BoxUser; | |
import java.io.BufferedReader; | |
import java.nio.charset.Charset; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Threading.Tasks; | |
using Box.V2.Config; | |
using Box.V2.JWTAuth; | |
namespace BoxGetAllUsers | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BoxFolderTreeBuilder | |
{ | |
public BoxClient BoxClient { get; set; } | |
public string RootFolderId { get; set; } | |
public int MaxDepth { get; set; } | |
public BoxFolderTreeBuilder(BoxClient boxClient, string rootFolderId = "0", int maxDepth = -1) | |
{ | |
this.BoxClient = boxClient; | |
this.RootFolderId = rootFolderId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.box; | |
import java.util.ArrayList; | |
import com.box.sdk.BoxDeveloperEditionAPIConnection; | |
import com.box.sdk.BoxFile; | |
import com.box.sdk.BoxFolder; | |
import com.box.sdk.BoxItem; | |
import com.eclipsesource.json.JsonArray; | |
import com.eclipsesource.json.JsonObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BoxFolderTreeBuilder { | |
constructor(boxClient, options) { | |
options = options || {}; | |
boxClient._useIterators = true; | |
this.boxClient = boxClient; | |
this.maxDepth = options.maxDepth || -1; | |
this.rootFolderId = options.rootFolderId || "0"; | |
} | |
async buildFolderTreeWithFlatLists() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const box = require('box-node-sdk'); | |
const fs = require('fs'); | |
const util = require('util'); | |
const path = require('path'); | |
let configFile = fs.readFileSync('config.json'); | |
configFile = JSON.parse(configFile); | |
let session = box.getPreconfiguredInstance(configFile); | |
let client = session.getAppAuthClient("enterprise"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.box; | |
import com.box.sdk.BoxConfig; | |
import com.box.sdk.BoxDeveloperEditionAPIConnection; | |
import com.box.sdk.BoxFile; | |
import com.box.sdk.BoxFolder; | |
import com.box.sdk.BoxItem; | |
import java.io.BufferedReader; | |
import java.io.FileOutputStream; | |
import java.io.IOException; |