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

http://google-enterprise-connector-manager.googlecode.com/ · Java · 37 lines · 21 code · 3 blank · 13 comment · 1 complexity · 4881c5b853361aef5b7691b315b821d5 MD5 · raw file

  1. package com.google.enterprise.connector.sp2c_migration;
  2. import java.util.List;
  3. //Copyright 2009 Google Inc.
  4. //
  5. //Licensed under the Apache License, Version 2.0 (the "License");
  6. //you may not use this file except in compliance with the License.
  7. //You may obtain a copy of the License at
  8. //
  9. //http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. //Unless required by applicable law or agreed to in writing, software
  12. //distributed under the License is distributed on an "AS IS" BASIS,
  13. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. //See the License for the specific language governing permissions and
  15. //limitations under the License.
  16. public class SP2CMain {
  17. public static void main(String[] args) {
  18. try {
  19. SharepointSite spSite = SharepointSiteFactory.getSharepointSite(args[0], args[1], args[2], args[3]);
  20. System.out.println("Traversing Sharepoint site: " + spSite.getUrl());
  21. List<Folder> rootFolders = spSite.getRootFolders();
  22. System.out.println("Root Folders [ " + rootFolders + " ]");
  23. for (Folder rootFolder : rootFolders) {
  24. System.out.println("Traversing root folder [ " + rootFolder + " ] ");
  25. List<Folder> folders = spSite.getFolders(rootFolder);
  26. System.out.println("Folders [ " + folders + " ]");
  27. List<Document> documents = spSite.getDocuments(rootFolder);
  28. System.out.println("Documents [ " + documents + " ]");
  29. }
  30. } catch (Exception e) {
  31. System.out.println(e);
  32. }
  33. }
  34. }