diff options
author | Sebastien Vincent <seb@jitsi.org> | 2010-10-04 09:33:50 +0000 |
---|---|---|
committer | Sebastien Vincent <seb@jitsi.org> | 2010-10-04 09:33:50 +0000 |
commit | 303c3dfbd6a2ef57a2ea7ffacc49dcf7aea62c90 (patch) | |
tree | 6442696d17ffa6a496b014185aa68cf0904cdc99 /src/net/java/sip/communicator/impl/fileaccess | |
parent | f7078b197ba877dc981592b927886f8d9a7fd143 (diff) | |
download | jitsi-303c3dfbd6a2ef57a2ea7ffacc49dcf7aea62c90.zip jitsi-303c3dfbd6a2ef57a2ea7ffacc49dcf7aea62c90.tar.gz jitsi-303c3dfbd6a2ef57a2ea7ffacc49dcf7aea62c90.tar.bz2 |
Fixes warnings and javadocs.
Diffstat (limited to 'src/net/java/sip/communicator/impl/fileaccess')
-rw-r--r-- | src/net/java/sip/communicator/impl/fileaccess/FileAccessActivator.java | 19 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java | 25 |
2 files changed, 34 insertions, 10 deletions
diff --git a/src/net/java/sip/communicator/impl/fileaccess/FileAccessActivator.java b/src/net/java/sip/communicator/impl/fileaccess/FileAccessActivator.java index c9ea718..0c59fa0 100644 --- a/src/net/java/sip/communicator/impl/fileaccess/FileAccessActivator.java +++ b/src/net/java/sip/communicator/impl/fileaccess/FileAccessActivator.java @@ -12,23 +12,40 @@ import net.java.sip.communicator.service.fileaccess.*; /** * Invoke "Service Binder" to parse the service XML and register all services. - * + * * @author Alexander Pelov * @author Lubomir Marinov */ public class FileAccessActivator implements BundleActivator { + /** + * The service registration. + */ private ServiceRegistration serviceRegistration; + /** + * Initialize and start file service + * + * @param bundleContext the <tt>BundleContext</tt> + * @throws Exception if initializing and starting file service fails + */ public void start(BundleContext bundleContext) + throws Exception { serviceRegistration = bundleContext.registerService(FileAccessService.class.getName(), new FileAccessServiceImpl(), null); } + /** + * Stops this bundle. + * + * @param bundleContext the <tt>BundleContext</tt> + * @throws Exception if the stop operation goes wrong + */ public void stop(BundleContext bundleContext) + throws Exception { if (serviceRegistration != null) { diff --git a/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java b/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java index c25caab..0615463 100644 --- a/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java +++ b/src/net/java/sip/communicator/impl/fileaccess/FileAccessServiceImpl.java @@ -20,7 +20,7 @@ import net.java.sip.communicator.util.*; * @author Alexander Pelov * @author Lubomir Marinov */ -public class FileAccessServiceImpl implements FileAccessService +public class FileAccessServiceImpl implements FileAccessService { /** @@ -70,6 +70,12 @@ public class FileAccessServiceImpl implements FileAccessService return retVal; } + /** + * Returns the temporary directory. + * + * @return the created temporary directory + * @throws IOException if the temporary directory cannot not be created + */ public File getTemporaryDirectory() throws IOException { File file = getTemporaryFile(); @@ -249,7 +255,7 @@ public class FileAccessServiceImpl implements FileAccessService return scHomeDirName; } - + /** * Returns the location of the directory where SIP Communicator is to store * user specific data such as configuration files, message and call history @@ -322,13 +328,13 @@ public class FileAccessServiceImpl implements FileAccessService homedir = homedir.trim(); if (!homedir.endsWith(File.separator)) - { + { homedir += File.separator; } file = new File(homedir + fileName); if (file.canRead() || file.canWrite()) - { + { return file; } @@ -340,7 +346,7 @@ public class FileAccessServiceImpl implements FileAccessService logger.debug("Creating home directory : " + homedirFile.getAbsolutePath()); if (!homedirFile.mkdirs()) - { + { String message = "Could not create the home directory : " + homedirFile.getAbsolutePath(); @@ -367,8 +373,9 @@ public class FileAccessServiceImpl implements FileAccessService /** * Returns the default download directory. - * + * * @return the default download directory + * @throws IOException if it I/O error occurred */ public File getDefaultDownloadDirectory() throws IOException @@ -379,7 +386,7 @@ public class FileAccessServiceImpl implements FileAccessService // would be the home directory (i.e. the Desktop folder). if (OSUtils.IS_WINDOWS && getMajorOSVersion() <= 5) { - FileSystemView fsv = FileSystemView.getFileSystemView(); + FileSystemView fsv = FileSystemView.getFileSystemView(); downloadDir = fsv.getHomeDirectory(); } @@ -425,9 +432,9 @@ public class FileAccessServiceImpl implements FileAccessService /** * Creates a failsafe transaction which can be used to safely store * informations into a file. - * + * * @param file The file concerned by the transaction, null if file is null. - * + * * @return A new failsafe transaction related to the given file. */ public FailSafeTransaction createFailSafeTransaction(File file) |