public class OnpremiseSharepointService extends Object implements SharepointService
Modifier and Type | Field and Description |
---|---|
protected org.apache.http.impl.client.CloseableHttpClient |
httpClient |
protected org.apache.http.protocol.HttpContext |
httpContext |
Constructor and Description |
---|
OnpremiseSharepointService(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.apache.http.protocol.HttpContext httpContext,
URL siteUrl,
IMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
<T> T |
addBlob(String url,
org.apache.http.HttpEntity entity,
Class<T> clazz,
boolean unwrapConfig) |
SharepointFile |
addFile(String filename,
String folderPath,
org.apache.http.HttpEntity entity,
Boolean overwrite) |
void |
approveFile(String filename,
String folderPath,
String comment) |
SharePointAttachResult |
attachFile(String filename,
String listTitle,
String itemId,
org.apache.http.HttpEntity entity) |
void |
checkInFile(String filename,
String folderPath,
String checkInType,
String comment) |
void |
checkoutFile(String filename,
String folderPath) |
void |
close() |
void |
copyFileTo(String filename,
String folderPath,
String newFilePath,
Boolean overwrite) |
SharepointFolder |
createFolder(SharepointFolder folder) |
SharepointList |
createList(SharepointList list) |
Map<String,Object> |
createListItem(String id,
SharepointListItem item) |
protected void |
delete(String path) |
void |
deleteFile(String filename,
String folderPath) |
void |
deleteFolder(String serverRelativeUrl) |
void |
deleteList(String id) |
void |
deleteListItem(String listId,
String itemId) |
void |
denyFile(String filename,
String folderPath,
String comment) |
protected <T> T |
exchangeForObject(String path,
org.springframework.http.HttpMethod method,
org.springframework.http.HttpEntity<?> requestEntity,
Class<T> clazz) |
protected URI |
getAbsoluteUri(String path) |
SharepointListItem |
getAllItemFields(String fileServerRelativeUrl,
Map<String,Object> updatedProperties) |
byte[] |
getFileContent(String filename,
String folderPath) |
SharepointFile |
getFileMetadata(String filename,
String folderPath) |
SharepointFile |
getFileMetadata(String filename,
String folderPath,
String query) |
SharepointFolder |
getFolder(String serverRelativeUrl) |
String |
getFormDigestValue() |
<T> T |
getForObject(String path,
Class<T> clazz) |
SharepointList |
getList(String id,
String query) |
List<SharepointListField> |
getListFields(String id,
String query) |
Map<String,Object> |
getListItemById(String listId,
Integer id) |
SharepointListItemResults |
getListItems(String id,
String query) |
SharepointListItemResults |
getListItems(String id,
String query,
Boolean queryEncoded) |
List<SharepointList> |
getLists(String query) |
SharepointListItemResults |
getPage(String pageUrl) |
protected String |
getServerRelativeUrlFromMetadata(Map<String,Object> folder) |
String |
getWebId() |
void |
init(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.apache.http.protocol.HttpContext httpContext,
URL siteUrl) |
SharepointListItem |
listItemAllFields(String fileRelativeUrl) |
protected <T> T |
postForObject(String path,
Object object,
Class<T> clazz) |
protected <T> T |
postForObject(String path,
Object object,
Class<T> clazz,
Boolean withFormDigest) |
void |
publishFile(String filename,
String folderPath,
String comment) |
List<Map<String,Object>> |
queryFile(String query,
String parsedFolderPath,
Boolean recursive) |
List<Map<String,Object>> |
queryFolders(String query,
String folderPath,
Boolean recursive) |
String |
recycleFile(String filename,
String folderPath) |
List<Map<String,Object>> |
resolveCollection(String url) |
Map<String,Object> |
resolveCreate(String url,
Object body) |
void |
resolveDelete(String url) |
SharepointMapResult |
resolveMapResult(String url,
org.apache.http.HttpEntity entity,
boolean unwrapConfig) |
Map<String,Object> |
resolveObject(String url) |
<T> T |
resolvePost(String url,
Object body,
Class<T> clazz) |
void |
resolveUpdate(String url,
Object body) |
void |
undoCheckOut(String filename,
String folderPath) |
void |
unpublishFile(String filename,
String folderPath,
String comment) |
protected <T> T |
update(String path,
Object updatedFields,
Class<T> clazz) |
void |
updateFileMetadata(SharepointListItem file,
Map<String,Object> updatedProperties) |
void |
updateFolder(String serverRelativeUrl,
Map<String,Object> updatedFields) |
void |
updateList(String listId,
SharepointList list) |
void |
updateListItem(String listId,
String itemId,
Map<String,Object> updatedFields) |
protected org.apache.http.impl.client.CloseableHttpClient httpClient
protected org.apache.http.protocol.HttpContext httpContext
public String getWebId() throws SharepointException
getWebId
in interface SharepointService
SharepointException
public String getFormDigestValue() throws SharepointException
getFormDigestValue
in interface SharepointService
SharepointException
public SharepointList getList(String id, String query) throws SharepointException
getList
in interface SharepointService
SharepointException
public SharepointListItemResults getListItems(String id, String query) throws SharepointException
getListItems
in interface SharepointService
SharepointException
public Map<String,Object> getListItemById(String listId, Integer id) throws SharepointException
getListItemById
in interface SharepointService
SharepointException
public SharepointListItemResults getListItems(String id, String query, Boolean queryEncoded) throws SharepointException
getListItems
in interface SharepointService
SharepointException
public List<SharepointList> getLists(String query) throws SharepointException
getLists
in interface SharepointService
SharepointException
public List<SharepointListField> getListFields(String id, String query) throws SharepointException
getListFields
in interface SharepointService
SharepointException
public void deleteList(String id) throws SharepointException
deleteList
in interface SharepointService
SharepointException
public SharepointList createList(SharepointList list) throws SharepointException
createList
in interface SharepointService
SharepointException
public void updateList(String listId, SharepointList list) throws SharepointException
updateList
in interface SharepointService
SharepointException
public Map<String,Object> createListItem(String id, SharepointListItem item) throws SharepointException
createListItem
in interface SharepointService
SharepointException
public void deleteListItem(String listId, String itemId) throws SharepointException
deleteListItem
in interface SharepointService
SharepointException
public SharePointAttachResult attachFile(String filename, String listTitle, String itemId, org.apache.http.HttpEntity entity) throws SharepointException
attachFile
in interface SharepointService
SharepointException
public void updateListItem(String listId, String itemId, Map<String,Object> updatedFields) throws SharepointException
updateListItem
in interface SharepointService
SharepointException
public SharepointFolder createFolder(SharepointFolder folder) throws SharepointException
createFolder
in interface SharepointService
SharepointException
public SharepointFolder getFolder(String serverRelativeUrl) throws SharepointException
getFolder
in interface SharepointService
SharepointException
public SharepointListItem listItemAllFields(String fileRelativeUrl) throws SharepointException
listItemAllFields
in interface SharepointService
SharepointException
public void deleteFolder(String serverRelativeUrl) throws SharepointException
deleteFolder
in interface SharepointService
SharepointException
public void updateFolder(String serverRelativeUrl, Map<String,Object> updatedFields) throws SharepointException
updateFolder
in interface SharepointService
SharepointException
public List<Map<String,Object>> queryFolders(String query, String folderPath, Boolean recursive) throws SharepointException
queryFolders
in interface SharepointService
SharepointException
public <T> T addBlob(String url, org.apache.http.HttpEntity entity, Class<T> clazz, boolean unwrapConfig) throws SharepointException
addBlob
in interface SharepointService
SharepointException
public SharepointFile addFile(String filename, String folderPath, org.apache.http.HttpEntity entity, Boolean overwrite) throws SharepointException
addFile
in interface SharepointService
SharepointException
public SharepointFile getFileMetadata(String filename, String folderPath) throws SharepointException
getFileMetadata
in interface SharepointService
SharepointException
public SharepointFile getFileMetadata(String filename, String folderPath, String query) throws SharepointException
getFileMetadata
in interface SharepointService
SharepointException
public void deleteFile(String filename, String folderPath) throws SharepointException
deleteFile
in interface SharepointService
SharepointException
public byte[] getFileContent(String filename, String folderPath) throws SharepointException
getFileContent
in interface SharepointService
SharepointException
public void checkoutFile(String filename, String folderPath) throws SharepointException
checkoutFile
in interface SharepointService
SharepointException
public void checkInFile(String filename, String folderPath, String checkInType, String comment) throws SharepointException
checkInFile
in interface SharepointService
SharepointException
public void undoCheckOut(String filename, String folderPath) throws SharepointException
undoCheckOut
in interface SharepointService
SharepointException
public void publishFile(String filename, String folderPath, String comment) throws SharepointException
publishFile
in interface SharepointService
SharepointException
public void unpublishFile(String filename, String folderPath, String comment) throws SharepointException
unpublishFile
in interface SharepointService
SharepointException
public void approveFile(String filename, String folderPath, String comment) throws SharepointException
approveFile
in interface SharepointService
SharepointException
public void denyFile(String filename, String folderPath, String comment) throws SharepointException
denyFile
in interface SharepointService
SharepointException
public List<Map<String,Object>> queryFile(String query, String parsedFolderPath, Boolean recursive) throws SharepointException
queryFile
in interface SharepointService
SharepointException
public void copyFileTo(String filename, String folderPath, String newFilePath, Boolean overwrite) throws SharepointException
copyFileTo
in interface SharepointService
SharepointException
public String recycleFile(String filename, String folderPath) throws SharepointException
recycleFile
in interface SharepointService
SharepointException
public Map<String,Object> resolveObject(String url) throws SharepointException
resolveObject
in interface SharepointService
SharepointException
public List<Map<String,Object>> resolveCollection(String url) throws SharepointException
resolveCollection
in interface SharepointService
SharepointException
public Map<String,Object> resolveCreate(String url, Object body) throws SharepointException
resolveCreate
in interface SharepointService
SharepointException
public void resolveUpdate(String url, Object body) throws SharepointException
resolveUpdate
in interface SharepointService
SharepointException
public void resolveDelete(String url) throws SharepointException
resolveDelete
in interface SharepointService
SharepointException
public <T> T resolvePost(String url, Object body, Class<T> clazz) throws SharepointException
resolvePost
in interface SharepointService
SharepointException
protected String getServerRelativeUrlFromMetadata(Map<String,Object> folder)
public SharepointListItem getAllItemFields(String fileServerRelativeUrl, Map<String,Object> updatedProperties) throws SharepointException
getAllItemFields
in interface SharepointService
SharepointException
public void updateFileMetadata(SharepointListItem file, Map<String,Object> updatedProperties) throws SharepointException
updateFileMetadata
in interface SharepointService
SharepointException
public SharepointMapResult resolveMapResult(String url, org.apache.http.HttpEntity entity, boolean unwrapConfig) throws SharepointException
resolveMapResult
in interface SharepointService
SharepointException
public SharepointListItemResults getPage(String pageUrl) throws SharepointException
getPage
in interface SharepointService
SharepointException
public void init(org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.protocol.HttpContext httpContext, URL siteUrl)
init
in interface SharepointService
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public <T> T getForObject(String path, Class<T> clazz) throws SharepointException
getForObject
in interface SharepointService
SharepointException
protected <T> T postForObject(String path, Object object, Class<T> clazz) throws SharepointException
SharepointException
protected <T> T postForObject(String path, Object object, Class<T> clazz, Boolean withFormDigest) throws SharepointException
SharepointException
protected void delete(String path) throws SharepointException
SharepointException
protected <T> T update(String path, Object updatedFields, Class<T> clazz) throws SharepointException
SharepointException
protected <T> T exchangeForObject(String path, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, Class<T> clazz) throws SharepointException
SharepointException
protected URI getAbsoluteUri(String path) throws SharepointException
SharepointException
Copyright © 2010–2020. All rights reserved.