You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Guy Mahieu (JIRA)" <ji...@apache.org> on 2008/09/20 12:39:44 UTC

[jira] Created: (IVY-912) Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager inteface?

Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  inteface?
---------------------------------------------------------------------------------------

                 Key: IVY-912
                 URL: https://issues.apache.org/jira/browse/IVY-912
             Project: Ivy
          Issue Type: Wish
          Components: Core
    Affects Versions: 2.0.0-beta-2
            Reporter: Guy Mahieu


I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact? If not, can this method become part of the interface so the usabiliti of the API increases?

Small code snippet to illustrate the current API usage:
            RepositoryCacheManager repositoryCacheManager = resolver.getRepositoryCacheManager();
            if (repositoryCacheManager instanceof DefaultRepositoryCacheManager) {
                DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
                projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());
            } else {
                // TODO Check with Ivy dev team if the getArchiveFileInCache method can be pulled up to the interface
                throw new RuntimeException("Unsupported RepositoryCacheManager type: " + repositoryCacheManager.getClass().getName());
            }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-912) Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager interface?

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650357#action_12650357 ] 

Maarten Coene commented on IVY-912:
-----------------------------------

The problem is that it is possible that the artifact isn't in the cache (can happen if you set useOrigin="true" on the cache element in your settings.xml).
In that case, the File returned by that method will probably not exist.

You should take a look at the IvyCachePath task to have an example of getting the resolved artifacts as file paths by using the ResolveReport.
If I'm not mistaken, IvyDE (the eclipse plugin) uses a similar approach.

> Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  interface?
> ----------------------------------------------------------------------------------------
>
>                 Key: IVY-912
>                 URL: https://issues.apache.org/jira/browse/IVY-912
>             Project: Ivy
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Guy Mahieu
>
> I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
> To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.
> Was this an intentional decision, if so: how should I lookup the archive for the artifact?
> If not, can this method become part of the interface so the usability of the API increases?
> Small code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
>   DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
>   projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
> }  
> {noformat} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-912) Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager interface?

Posted by "Guy Mahieu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guy Mahieu updated IVY-912:
---------------------------

    Description: 
I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact?
If not, can this method become part of the interface so the usabiliti of the API increases?

Small code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
  DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
  projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
}  
{noformat} 

  was:
I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact? If not, can this method become part of the interface so the usabiliti of the API increases?

Small pseudo code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
  DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
  projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
}  
{noformat} 


> Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  interface?
> ----------------------------------------------------------------------------------------
>
>                 Key: IVY-912
>                 URL: https://issues.apache.org/jira/browse/IVY-912
>             Project: Ivy
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Guy Mahieu
>
> I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
> To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.
> Was this an intentional decision, if so: how should I lookup the archive for the artifact?
> If not, can this method become part of the interface so the usabiliti of the API increases?
> Small code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
>   DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
>   projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
> }  
> {noformat} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-912) Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager interface?

Posted by "Guy Mahieu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guy Mahieu updated IVY-912:
---------------------------

    Description: 
I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact? If not, can this method become part of the interface so the usabiliti of the API increases?

Small pseudo code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
  DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
  projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
}  
{noformat} 

  was:
I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact? If not, can this method become part of the interface so the usabiliti of the API increases?

Small code snippet to illustrate the current API usage:
            RepositoryCacheManager repositoryCacheManager = resolver.getRepositoryCacheManager();
            if (repositoryCacheManager instanceof DefaultRepositoryCacheManager) {
                DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
                projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());
            } else {
                // TODO Check with Ivy dev team if the getArchiveFileInCache method can be pulled up to the interface
                throw new RuntimeException("Unsupported RepositoryCacheManager type: " + repositoryCacheManager.getClass().getName());
            }



        Summary: Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  interface?  (was: Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  inteface?)

> Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  interface?
> ----------------------------------------------------------------------------------------
>
>                 Key: IVY-912
>                 URL: https://issues.apache.org/jira/browse/IVY-912
>             Project: Ivy
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Guy Mahieu
>
> I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
> To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.
> Was this an intentional decision, if so: how should I lookup the archive for the artifact? If not, can this method become part of the interface so the usabiliti of the API increases?
> Small pseudo code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
>   DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
>   projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
> }  
> {noformat} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-912) Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager interface?

Posted by "Guy Mahieu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guy Mahieu updated IVY-912:
---------------------------

    Description: 
I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact?
If not, can this method become part of the interface so the usability of the API increases?

Small code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
  DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
  projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
}  
{noformat} 

  was:
I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.

Was this an intentional decision, if so: how should I lookup the archive for the artifact?
If not, can this method become part of the interface so the usabiliti of the API increases?

Small code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
  DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
  projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
}  
{noformat} 


> Can the getArchiveFileInCache() methods be put on the RepositoryCacheManager  interface?
> ----------------------------------------------------------------------------------------
>
>                 Key: IVY-912
>                 URL: https://issues.apache.org/jira/browse/IVY-912
>             Project: Ivy
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Guy Mahieu
>
> I'm writing an IDE plugin, and I need to access the filepath of a resolved dependency to add to the dependencies of the IDE project.
> To do this, I needed to use the DefaultRepositoryCacheManager directly since the getArchiveFileInCache(artifact) method is not on the interface.
> Was this an intentional decision, if so: how should I lookup the archive for the artifact?
> If not, can this method become part of the interface so the usability of the API increases?
> Small code snippet to illustrate the current API usage: {noformat} if (repositoryCacheManager instanceof DefaultRepositoryCacheManager)   {
>   DefaultRepositoryCacheManager defaultRepositoryCacheManager = (DefaultRepositoryCacheManager) repositoryCacheManager;
>   projectDependencies.add(defaultRepositoryCacheManager.getArchiveFileInCache(artifact).getAbsolutePath());         
> }  
> {noformat} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.