Changeset 9941
- Timestamp:
- 2005-05-24T16:37:52+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/gsdlCGI.pm
r7956 r9941 62 62 # ensure only alpha-numeric plus a few other special chars remain 63 63 64 $val =~ s/[^[:alnum:]@\.\/\- : ]//g if (defined $val);64 $val =~ s/[^[:alnum:]@\.\/\- :_]//g if (defined $val); 65 65 66 66 return $val; … … 145 145 } 146 146 147 sub get_gsdl_home { 148 my $self = shift @_; 149 150 my $gsdlhome = $self->get_config_info("gsdlhome"); 151 152 # Unix specific 153 $gsdlhome =~ s/\/$//; # remove trailing slash 154 155 return $gsdlhome; 156 } 147 157 148 158 … … 166 176 } 167 177 178 sub mkdir 179 { 180 my $self = shift @_; 181 my ($dir) = @_; 182 183 184 # Currently, Unix specific, need to generalise to Windows etc. 185 # => hook in with util.pm ? 186 187 my $cmd = "mkdir $dir 2>&1"; # Unix specific 188 189 my $output = `$cmd`; 190 191 if ($?>0) { 192 $self->generate_error("Failed to create directory: $dir\n\n$output"); 193 } 194 } 195 196 sub check_for_java() 197 { 198 my $self = shift @_; 199 200 my $java = "java"; 201 202 if (defined $ENV{'JAVA_HOME'}) { 203 my $java_home = $ENV{'JAVA_HOME'}; 204 # Unix specific 205 $java_home =~ s/\/$//; # remove trailing slash if present 206 $java = "$java_home/bin/java"; # Unix specific 207 } 208 else { 209 $self->generate_error("Unable to file java"); 210 } 211 212 213 return $java; 214 } 215 168 216 sub unix_cmd 169 217 {
Note:
See TracChangeset
for help on using the changeset viewer.