<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,22 +10,6 @@
 
 @implementation CocoaWebResourceViewController
 
-// setup the docroot for the http server
-- (NSString*)setupDocroot
-{
-	NSString* docroot =[NSString stringWithFormat:@&quot;%@/tmp/docroot&quot;, NSHomeDirectory()];
-	NSLog(docroot);
-	NSFileManager *manager = [NSFileManager defaultManager];
-	NSError *error;
-	if(![manager removeItemAtPath:docroot error:&amp;error])
-	{
-		NSLog(@&quot;Can not remove old docroot: %@&quot;, error);
-	}
-	NSString *path = [NSString stringWithFormat:@&quot;%@/%@&quot;, [[NSBundle mainBundle] bundlePath], @&quot;docroot&quot;];
-	[manager createSymbolicLinkAtPath:docroot withDestinationPath:path error:&amp;error];
-	return docroot;
-}
-
 // load file list
 - (void)loadFileList
 {
@@ -45,15 +29,12 @@
 	fileList = [[NSMutableArray alloc] init];
 	[self loadFileList];
 	
-	// setup the docroot for the http server
-	NSString * docroot = [self setupDocroot];
-
+	// set up the http server
 	httpServer = [[HTTPServer alloc] init];
-	[httpServer setType:@&quot;_http._tcp.&quot;];
-	
+	[httpServer setType:@&quot;_http._tcp.&quot;];	
 	[httpServer setPort:8080];
 	[httpServer setName:@&quot;CocoaWebResource&quot;];
-	[httpServer setDocumentRoot:docroot];
+	[httpServer setupBuiltInDocroot];
 	httpServer.fileResourceDelegate = self;
 
     [super viewDidLoad];</diff>
      <filename>Classes/CocoaWebResourceViewController.m</filename>
    </modified>
    <modified>
      <diff>@@ -67,4 +67,6 @@
 - (int)numberOfHTTPConnections;
 
 - (NSString*)hostName;
+
+- (void)setupBuiltInDocroot;
 @end</diff>
      <filename>CocoaWebResource/HTTPServer.h</filename>
    </modified>
    <modified>
      <diff>@@ -359,4 +359,22 @@
 	NSLog(@&quot;Error Dict: %@&quot;, errorDict);
 }
 
+#pragma mark built-in web service
+
+// setup the docroot for the http server
+- (void)setupBuiltInDocroot
+{
+	NSString* docroot =[NSString stringWithFormat:@&quot;%@/tmp/docroot&quot;, NSHomeDirectory()];
+	NSLog(docroot);
+	NSFileManager *manager = [NSFileManager defaultManager];
+	NSError *error;
+	if(![manager removeItemAtPath:docroot error:&amp;error])
+	{
+		NSLog(@&quot;Can not remove old docroot: %@&quot;, error);
+	}
+	NSString *path = [NSString stringWithFormat:@&quot;%@/%@&quot;, [[NSBundle mainBundle] bundlePath], @&quot;docroot&quot;];
+	[manager createSymbolicLinkAtPath:docroot withDestinationPath:path error:&amp;error];
+	[self setDocumentRoot:docroot];
+}
+
 @end</diff>
      <filename>CocoaWebResource/HTTPServer.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>864961312daafa690ae084bbcae203cc1a35f872</id>
    </parent>
  </parents>
  <author>
    <name>Robin Lu</name>
    <email>iamawalrus@gmail.com</email>
  </author>
  <url>http://github.com/robin/cocoa-web-resource/commit/8c1736c954b89e229abc8f4121213eacd185c0ca</url>
  <id>8c1736c954b89e229abc8f4121213eacd185c0ca</id>
  <committed-date>2008-12-01T05:59:38-08:00</committed-date>
  <authored-date>2008-12-01T05:59:38-08:00</authored-date>
  <message>move docroot setup into httpserver</message>
  <tree>2ebc1a0c431097f8a55e1dd404e8daded5ef22d4</tree>
  <committer>
    <name>Robin Lu</name>
    <email>iamawalrus@gmail.com</email>
  </committer>
</commit>
