PageRenderTime 24ms CodeModel.GetById 9ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/projects/sharepoint-proto/source/javatests/com/google/enterprise/connector/sp2c_migration/MockSharepointServerUsingFileSystem.java

http://google-enterprise-connector-manager.googlecode.com/
Java | 58 lines | 41 code | 15 blank | 2 comment | 0 complexity | 508e9c595858e00e17ac0a9b9b507f42 MD5 | raw file
 1// Copyright 2010 Google Inc. All Rights Reserved.
 2
 3package com.google.enterprise.connector.sp2c_migration;
 4
 5
 6
 7import java.io.InputStream;
 8import java.util.ArrayList;
 9import java.util.List;
10import java.util.Set;
11
12public class MockSharepointServerUsingFileSystem implements SharepointSite {
13  
14  private FolderTraverser traverser;
15  
16  public MockSharepointServerUsingFileSystem(String sharePointUrl, String loginName, String password) {
17    traverser = new FolderTraverser(sharePointUrl);
18  }
19
20  @Override
21  public InputStream getDocumentContent(Document document) throws Exception {
22    return traverser.getDocumentContents(document.getId());
23  }
24
25  @Override
26  public List<Document> getDocuments(Folder rootfolder) throws Exception {
27    return traverser.getDocuments();
28  }
29
30  @Override
31  public List<Folder> getFolders(Folder rootfolder) throws Exception {
32    return traverser.getFolders();
33  }
34
35  @Override
36  public String getId() {
37    return null;
38  }
39
40  @Override
41  public List<Folder> getRootFolders() throws Exception {
42    List<Folder> roots = new ArrayList<Folder>();
43    roots.add(traverser.getRootFolder());
44    return roots;
45  }
46
47  @Override
48  public String getUrl() {
49    return "Site URL";
50  }
51
52  @Override
53  public Set<String> getDirectChildSites() throws Exception {
54    // TODO Auto-generated method stub
55    return null;
56  }
57
58}