/[volute]/trunk/projects/grid/vospace/php_endpoint/backends/file_system/node.php
ViewVC logotype

Contents of /trunk/projects/grid/vospace/php_endpoint/backends/file_system/node.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 734 - (show annotations)
Tue Aug 19 19:37:17 2008 UTC (12 years, 3 months ago) by richard.p.wagner
File size: 1223 byte(s)
working on listing nodes
1 <?php
2
3 require_once(BACKEND.'config.backend.inc');
4
5 class Node {
6
7 public $uri;
8 public $file_path;
9 public $properties;
10 public $endpoint;
11
12 function __construct($uri) {
13 $this->uri = $uri;
14 $this->properties = array();
15 $this->file_path = str_replace( VOSPACE_ROOT.'/', FILE_SYSTEM_ROOT, $uri );
16 $this->endpoint = str_replace( VOSPACE_ROOT.'/', HTTP_ROOT, $uri );
17 }
18
19 function populateProperties($detail = "min"){
20 // Tells the node to fill in it's properties values.
21 // File or directory had better exist!
22 global $provided_properties;
23 $f_stats = stat($this->file_path);
24 $this->properties = $provided_properties;
25 $this->properties[0]["_"] = $f_stats["size"];
26 $this->properties[1]["_"] = DATA_OWNER;
27 $this->properties[2]["_"] = $f_stats["mtime"];
28 $this->properties[3]["_"] = $f_stats["ctime"];
29 }
30
31 function exists(){
32 if( file_exists( $this->file_path ) )
33 return True;
34 return False;
35 }
36
37 function getView(){
38 return array('uri' => 'ivo://net.ivoa.vospace/views#identity',
39 'original'=>True);
40 }
41
42 function getProtocols(){
43 return array('endpoint' => $this->endpoint,
44 'uri' => 'ivo://net.ivoa.vospace/protocols#http-client');
45 }
46 }
47
48 ?>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26