@Test public void removeFile() throws InterruptedException { List<String> items = addThreeFiles().stream().map((item) -> item.id).collect(Collectors.toList()); String removedDriveItemId = items.remove(0); List<String> expectedItems = items; oneDriveAPI.removeFile(removedDriveItemId); List<String> actualItems = graphClient.me() .drive() .root() .children() .buildRequest() .get() .getCurrentPage() .stream() .map((item) -> item.id) .collect(Collectors.toList()); assertTrue(expectedItems.size() == actualItems.size() && expectedItems.containsAll(actualItems) && actualItems.containsAll(expectedItems)); exception.expect(GraphServiceException.class); graphClient.me().drive().items(removedDriveItemId).buildRequest().get(); }
public void removeFile(String fileId) { graphClient.me().drive().items(fileId).buildRequest().delete(); }
OneDriveAPI { public void removeFile(String fileId) { graphClient.me().drive().items(fileId).buildRequest().delete(); } }
OneDriveAPI { public void removeFile(String fileId) { graphClient.me().drive().items(fileId).buildRequest().delete(); } OneDriveAPI(String clientId, String clientSecret, String authCode, String redirectUrl);   OneDriveAPI(String clientId,
              String clientSecret,
              String accessToken,
              String refreshToken,
              long expirationTime,
              String redirectUrl); }
OneDriveAPI { public void removeFile(String fileId) { graphClient.me().drive().items(fileId).buildRequest().delete(); } OneDriveAPI(String clientId, String clientSecret, String authCode, String redirectUrl);   OneDriveAPI(String clientId,
              String clientSecret,
              String accessToken,
              String refreshToken,
              long expirationTime,
              String redirectUrl); SharingLink createLink(String itemId, String type); void updateToken(OneDriveStoredToken newToken); void removeFolder(String fileId); void removeFile(String fileId); User getUser(); synchronized String getRootId(); synchronized String getUserId(); DriveItem createFolder(String parentId, String name, Calendar created); DriveItem copyFile(String parentId, String fileName, String fileId); DriveItem copyFolder(String parentId, String name, String folderId); OneDriveStoredToken getStoredToken(); @Deprecated String getNotificationUrl(); Subscription getSubscription(); DriveItem copy(String parentId, String fileName, String fileId, boolean isFile); IDriveItemCollectionPage getDriveItemCollectionPage(String folderId); @Deprecated List<DriveItem> getFiles(String folderId); ChangesIterator changes(String deltaToken); String getInsertUploadUrl(String parentId, String name, String conflictBehavior); DriveItem insert(String parentId, String fileName, Calendar created, Calendar modified, InputStream inputStream, String conflictBehavior); DriveItem updateFileContent(String itemId, Calendar created, Calendar modified, InputStream inputStream); DeltaDriveFiles getAllFiles(); DriveItem updateFile(DriveItem driveItem); DriveItem getItem(String itemId); Drive getDrive(); String getBusinessPreviewLink(String itemId); SimpleChildIterator getSimpleChildIterator(Collection<HashSetCompatibleDriveItem> items); ChildIterator getChildIterator(String folderId); }
OneDriveAPI { public void removeFile(String fileId) { graphClient.me().drive().items(fileId).buildRequest().delete(); } OneDriveAPI(String clientId, String clientSecret, String authCode, String redirectUrl);   OneDriveAPI(String clientId,
              String clientSecret,
              String accessToken,
              String refreshToken,
              long expirationTime,
              String redirectUrl); SharingLink createLink(String itemId, String type); void updateToken(OneDriveStoredToken newToken); void removeFolder(String fileId); void removeFile(String fileId); User getUser(); synchronized String getRootId(); synchronized String getUserId(); DriveItem createFolder(String parentId, String name, Calendar created); DriveItem copyFile(String parentId, String fileName, String fileId); DriveItem copyFolder(String parentId, String name, String folderId); OneDriveStoredToken getStoredToken(); @Deprecated String getNotificationUrl(); Subscription getSubscription(); DriveItem copy(String parentId, String fileName, String fileId, boolean isFile); IDriveItemCollectionPage getDriveItemCollectionPage(String folderId); @Deprecated List<DriveItem> getFiles(String folderId); ChangesIterator changes(String deltaToken); String getInsertUploadUrl(String parentId, String name, String conflictBehavior); DriveItem insert(String parentId, String fileName, Calendar created, Calendar modified, InputStream inputStream, String conflictBehavior); DriveItem updateFileContent(String itemId, Calendar created, Calendar modified, InputStream inputStream); DeltaDriveFiles getAllFiles(); DriveItem updateFile(DriveItem driveItem); DriveItem getItem(String itemId); Drive getDrive(); String getBusinessPreviewLink(String itemId); SimpleChildIterator getSimpleChildIterator(Collection<HashSetCompatibleDriveItem> items); ChildIterator getChildIterator(String folderId); final static String SCOPES; }