PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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