ShareUtilspublic class ShareUtils extends Object
Methods Summary |
---|
public static void | shareDir(AzureusCore azureus_core, Shell shell)
shareDirSupport( azureus_core, shell, false, false );
| public static void | shareDir(AzureusCore azureus_core, java.lang.String file_name)
new AEThread("shareDir")
{
public void
runSupport()
{
try{
azureus_core.getPluginManager().getDefaultPluginInterface().getShareManager().addDir(new File(file_name));
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
}.start();
| public static void | shareDirContents(AzureusCore azureus_core, Shell shell, boolean recursive)
shareDirSupport( azureus_core, shell, true, recursive );
| public static void | shareDirContents(AzureusCore azureus_core, java.lang.String file_name, boolean recursive)
new AEThread("shareDirCntents")
{
public void
runSupport()
{
try{
azureus_core.getPluginManager().getDefaultPluginInterface().getShareManager().addDirContents(new File(file_name), recursive);
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
}.start();
| protected static void | shareDirSupport(AzureusCore azureus_core, Shell shell, boolean contents, boolean recursive)
new AEThread("shareDirSupport")
{
public void
runSupport()
{
Display display = shell.getDisplay();
final String[] path = { null };
final AESemaphore sem = new AESemaphore("ShareUtils:dir");
display.asyncExec(new AERunnable() {
public void runSupport()
{
try{
DirectoryDialog dialog = new DirectoryDialog(shell, SWT.SYSTEM_MODAL);
dialog.setFilterPath( TorrentOpener.getFilterPathData() );
dialog.setText(
contents?
MessageText.getString("MainWindow.dialog.share.sharedircontents") +
(recursive?"("+MessageText.getString("MainWindow.dialog.share.sharedircontents.recursive")+")":""):
MessageText.getString("MainWindow.dialog.share.sharedir"));
path[0] = TorrentOpener.setFilterPathData( dialog.open() );
}finally{
sem.release();
}
}
});
sem.reserve();
if ( path[0] != null ){
if ( contents ){
shareDirContents( azureus_core, path[0], recursive );
}else{
shareDir( azureus_core, path[0] );
}
}
}
}.start();
| public static void | shareFile(AzureusCore azureus_core, Shell shell)
new AEThread("shareFile")
{
public void
runSupport()
{
Display display = shell.getDisplay();
final String[] path = { null };
final AESemaphore sem = new AESemaphore("ShareUtils:file");
display.asyncExec(new AERunnable() {
public void runSupport()
{
try{
FileDialog dialog = new FileDialog(shell, SWT.SYSTEM_MODAL | SWT.OPEN);
dialog.setFilterPath( TorrentOpener.getFilterPathData() );
dialog.setText(MessageText.getString("MainWindow.dialog.share.sharefile"));
path[0] = TorrentOpener.setFilterPathData( dialog.open() );
}finally{
sem.release();
}
}
});
sem.reserve();
if ( path[0] != null ){
shareFile( azureus_core, path[0] );
}
}
}.start();
| public static void | shareFile(AzureusCore azureus_core, java.lang.String file_name)
new AEThread("shareFile")
{
public void
runSupport()
{
try{
azureus_core.getPluginManager().getDefaultPluginInterface().getShareManager().addFile(new File(file_name));
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
}.start();
|
|