Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

I am currently using HyperContent 1.3 to access the files since it provides a nice filesystem abstraction layer, however, access would work just as well with Java Files. When the user logs in and accesses a channel that uses AFS, I attempt a HyperContent "mount". This is not Unix "mount" but just an initialization process for HyperContent. If this fails, HyperContent will report a FileSystemException and I prompt the user for their file system name and AFS password. System.exec is then called to execute the following shell script (see attached AFSFileSystem.java):

Code Block
borderStyle
borderStylesolid
titleShell Script to Initialize AFS Directorysolid
#!/bin/csh
set fsname = "$argv[1]"
set uname = "$argv[2]"
set pwd = "$argv[3]"
set dir = `hesinfo "$fsname" 'filsys'`
if ($status != 0) then
  exit 1
endif
set afs = `echo "$dir" | awk '{ print $2 }'`
pagsh -c /bin/csh <<EOT
klog "$uname" -password "$pwd"
/usr/bin/fs sa -dir "$afs" -acl portal rl
if (!(-e "$afs/.Portal")) then
  mkdir "$afs/.Portal"
  /usr/bin/fs sa -dir "$afs/.Portal" -acl portal rwlidwka
endif
unlog
exit
EOT

This will create the .Portal directory and give the "portal" user full access to this directory. Subsequent fill file access will occur normally.

...