/** * Default constructor. */ private AbstractStorageItem() { this.context = new RequestContext(); this.itemAttributes = new DefaultAttributes(); }
public void setResourceStoreRequest( ResourceStoreRequest request ) { this.request = request; this.context = new RequestContext( request.getRequestContext() ); }
private RequestContext filterItemContext(final RequestContext itemContext) { final RequestContext filtered = new RequestContext(); filtered.setParentContext(itemContext); return filtered; }
public ResourceStoreRequest( String requestPath, boolean localOnly, boolean remoteOnly ) { super(); this.requestPath = requestPath; this.pathStack = new Stack<String>(); this.processedRepositories = new ArrayList<String>(); this.appliedMappings = new HashMap<String, List<String>>(); this.requestContext = new RequestContext(); this.requestContext.setRequestLocalOnly( localOnly ); this.requestContext.setRequestRemoteOnly( remoteOnly ); }
/** * This method should be called ONLY when you load up a _legacy_ attribute using _legacy_ attribute store! */ public void upgrade() { this.context = new RequestContext(); this.itemAttributes = new DefaultAttributes(); // this here is for ITs only, some of them use "manually crafter" attributes XML files and would NPE // In "real life", all the files stored in Nexus have at least sha1/md5 set as attributes, meaning, // all the real life items has at least two attributes and this map would never be null! if ( attributes != null ) { getRepositoryItemAttributes().putAll( attributes ); } getRepositoryItemAttributes().setGeneration( generation ); getRepositoryItemAttributes().setPath( path ); getRepositoryItemAttributes().setReadable( readable ); getRepositoryItemAttributes().setWritable( writable ); getRepositoryItemAttributes().setRepositoryId( repositoryId ); getRepositoryItemAttributes().setCreated( created ); getRepositoryItemAttributes().setModified( modified ); getRepositoryItemAttributes().setStoredLocally( storedLocally ); getRepositoryItemAttributes().setCheckedRemotely( lastTouched ); getRepositoryItemAttributes().setLastRequested( lastRequested ); getRepositoryItemAttributes().setExpired( expired ); if ( !Strings.isNullOrEmpty( remoteUrl ) ) { getRepositoryItemAttributes().setRemoteUrl( remoteUrl ); } }