Revision 41706 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/DefaultInstallerManager.java
DefaultInstallerManager.java | ||
---|---|---|
128 | 128 |
return false; |
129 | 129 |
} |
130 | 130 |
|
131 |
public boolean contains(PackageInfo packageInfo) { |
|
132 |
if( !this.support(packageInfo.getType()) ) { |
|
133 |
return false; |
|
134 |
} |
|
135 |
String packageInfoName = packageInfo.getCode() + File.separator + PACKAGE_INFO_FILE_NAME; |
|
136 |
File packageInfoFile = new File(this.location,packageInfoName); |
|
137 |
return packageInfoFile.exists(); |
|
138 |
} |
|
139 |
|
|
131 | 140 |
public boolean support(String type) { |
132 | 141 |
for( String atype : this.types ) { |
133 | 142 |
if( atype != null ) { |
... | ... | |
470 | 479 |
} |
471 | 480 |
|
472 | 481 |
public File getDefaultLocalAddonRepository(String packageType) { |
482 |
return this.getDefaultLocalAddonRepository(packageType,ACCESS_READ); |
|
483 |
} |
|
484 |
|
|
485 |
public File getDefaultLocalAddonRepository(String packageType, int access) { |
|
473 | 486 |
File f = this.defaultRepositoryLocation.get(packageType); |
474 |
return f; |
|
487 |
switch(access) { |
|
488 |
case ACCESS_WRITE: |
|
489 |
if( f.canWrite() ) { |
|
490 |
return f; |
|
491 |
} |
|
492 |
break; |
|
493 |
case ACCESS_READ: |
|
494 |
default: |
|
495 |
if( f.canRead()) { |
|
496 |
return f; |
|
497 |
} |
|
498 |
break; |
|
499 |
} |
|
500 |
List<File> repositoriesLocaltions = this.getLocalAddonRepositories(packageType); |
|
501 |
for( File repositoryLocation : repositoriesLocaltions ) { |
|
502 |
switch(access) { |
|
503 |
case ACCESS_WRITE: |
|
504 |
if( repositoryLocation.canWrite() ) { |
|
505 |
return repositoryLocation; |
|
506 |
} |
|
507 |
break; |
|
508 |
case ACCESS_READ: |
|
509 |
default: |
|
510 |
if( repositoryLocation.canRead()) { |
|
511 |
return repositoryLocation; |
|
512 |
} |
|
513 |
break; |
|
514 |
} |
|
515 |
} |
|
516 |
return null; |
|
475 | 517 |
} |
476 | 518 |
|
477 | 519 |
public void setDefaultLocalAddonRepository(File defaultAddonsRepository, String packageType) { |
Also available in: Unified diff